mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 23:09:39 +03:00
[project @ 2005-06-27 01:57:54 by adrianl]
Fix termination of output from url_escape svn path=/import/netsurf/; revision=1770
This commit is contained in:
parent
ba6f228418
commit
8aed1103b6
@ -633,13 +633,15 @@ url_func_result url_escape(const char *unescaped, char **result)
|
||||
}
|
||||
}
|
||||
|
||||
(*result) = malloc(++d - escaped + 1);
|
||||
*d++ = '\0';
|
||||
|
||||
(*result) = malloc(d - escaped);
|
||||
if (!(*result)) {
|
||||
free(escaped);
|
||||
return URL_FUNC_NOMEM;
|
||||
}
|
||||
snprintf((*result), d - escaped, "%s", escaped);
|
||||
(*result)[d - escaped] = '\0';
|
||||
|
||||
memcpy((*result), escaped, d - escaped);
|
||||
|
||||
free(escaped);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user