From 56d06fcfce528f73f0a6310e21bc5fdce0dfa5a7 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 12 Sep 2011 23:12:44 +0100 Subject: Have shared pointers be pointed to rather than copied --- TODO | 2 -- getgbook.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index cb240b6..b6a11a4 100644 --- a/TODO +++ b/TODO @@ -16,8 +16,6 @@ bug in get(): if the \r\n\r\n after http headers is cut off between recv buffers what happens if we receive not a http header? does recv loop forever, in a memory killing manner? -be more reasonable with memory: point to cookies rather than copy them - print stderr in gui as well package for osx diff --git a/getgbook.c b/getgbook.c index f43abec..ff10e82 100644 --- a/getgbook.c +++ b/getgbook.c @@ -19,7 +19,7 @@ typedef struct { int num; char url[URLMAX]; char name[STRMAX]; - char cookie[COOKIEMAX]; + char *cookie; } Page; Page **pages; @@ -102,7 +102,7 @@ int getpageurls(char *pagecode, char *cookie) { *p = *d; } strncpy(p, "&q=subject:a", 13); - strncpy(pages[j]->cookie, cookie, COOKIEMAX); + pages[j]->cookie = cookie; break; } } -- cgit v1.2.3