diff options
author | Nick White <git@njw.me.uk> | 2012-03-29 11:37:03 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2012-03-29 11:37:03 +0100 |
commit | 4bfac013e70271e8273e41d2fa609d48db83a3b3 (patch) | |
tree | f91773fcaaa1a50696e56a03ee579dfb26834c2c /util.c | |
parent | 35e12cdf263178f62ef2fd7b9b2f3e5a9ad44fcf (diff) |
Use strncpy and strncat more safely
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -91,7 +91,7 @@ int get(char *host, char *path, char *sendcookie, char *savecookie, char **buf) t2 = h; if(savecookie != NULL) { while((t2 = strstr(t2, "Set-Cookie: ")) && sscanf(t2, m, c)) { - strncat(savecookie, c, COOKIEMAX); + strncat(savecookie, c, COOKIEMAX - strlen(savecookie) - 1); t2++; } } |