summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-08-18 21:35:45 +0100
committerNick White <git@njw.me.uk>2011-08-18 21:35:45 +0100
commit3ee5af0589fab8c0aec7425c3ca6ba3f27a9b35d (patch)
tree6b01fa00530ab44d0887c5a0aea44cd2af6b81b5
parent4f88334bc8752c34ff5d3bd545a6dcb35fc5faee (diff)
Little cleanup of util
-rw-r--r--util.c3
1 files changed, 1 insertions, 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);