From 3ee5af0589fab8c0aec7425c3ca6ba3f27a9b35d Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 18 Aug 2011 21:35:45 +0100 Subject: Little cleanup of util --- util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util.c b/util.c index 825a269..e030be6 100644 --- a/util.c +++ b/util.c @@ -72,8 +72,7 @@ int get(char *host, char *path, char *sendcookie, char *savecookie, char **buf) return 0; if(savecookie != NULL && sscanf(t, "Set-Cookie: %s;", c)) strncat(savecookie, c, COOKIEMAX); - t2 = strstr(t, "\r\n\r\n"); - if(t2) { + if((t2 = strstr(t, "\r\n\r\n")) != NULL) { t2+=4; l = res - (t2 - t); *buf = malloc(sizeof(char *) * l); -- cgit v1.2.3