mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 04:26:50 +03:00
remove warning by replacing sprintf snprintf
This commit is contained in:
parent
5dd5d5da4b
commit
eee67a65e8
@ -972,6 +972,9 @@ static char *form_url_encode(struct form *form,
|
||||
|
||||
assert(url_err == NSERROR_OK);
|
||||
|
||||
/* resize string to allow for new key/value pair,
|
||||
* equals, amphersand and terminator
|
||||
*/
|
||||
len1 = len + strlen(name) + strlen(value) + 2;
|
||||
s2 = realloc(s, len1 + 1);
|
||||
if (!s2) {
|
||||
@ -981,7 +984,8 @@ static char *form_url_encode(struct form *form,
|
||||
return NULL;
|
||||
}
|
||||
s = s2;
|
||||
sprintf(s + len, "%s=%s&", name, value);
|
||||
|
||||
snprintf(s + len, (len1 + 1) - len, "%s=%s&", name, value);
|
||||
len = len1;
|
||||
free(name);
|
||||
free(value);
|
||||
|
Loading…
Reference in New Issue
Block a user