summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2012-03-29 11:49:27 +0100
committerNick White <git@njw.me.uk>2012-03-29 11:49:27 +0100
commit7d2f01ff65f2755aa375eab6134a00d9acd13369 (patch)
tree819f4c90c0bcd11194cea6328c50884080bde5df /util.c
parent4bfac013e70271e8273e41d2fa609d48db83a3b3 (diff)
Clean up string usage
Diffstat (limited to 'util.c')
-rw-r--r--util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util.c b/util.c
index 41bbc3c..093c157 100644
--- a/util.c
+++ b/util.c
@@ -72,7 +72,7 @@ int get(char *host, char *path, char *sendcookie, char *savecookie, char **buf)
snprintf(m, 256, "Set-Cookie: %%%ds;", COOKIEMAX-1);
while((res = recv(fd, t, BUFSIZ, 0)) > 0) {
- strncat(h, t, BUFSIZ - strlen(h) - 1);
+ strncat(h, t, sizeof(h) - strlen(h) - 1);
if((t2 = strstr(t, "\r\n\r\n")) != NULL && (t2 - t) < (signed)res) {
/* end of header, save rest to buffer */
t2+=4;
@@ -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 - strlen(savecookie) - 1);
+ strncat(savecookie, c, sizeof(savecookie) - strlen(savecookie) - 1);
t2++;
}
}