From cc7913b3f694dcf920fb25e807cf46f283fde160 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 15 Sep 2011 18:54:56 +0100 Subject: Harden pointer arithetic --- getgbook.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/getgbook.c b/getgbook.c index ff10e82..05bcc7b 100644 --- a/getgbook.c +++ b/getgbook.c @@ -44,7 +44,7 @@ int getpagelist() return 0; s+=strlen("_OC_Run({\"page\":["); - for(i=0, p=pages[0];*s; s++) { + for(i=0, p=pages[0];*s && iurl, d=c+strlen("\"src\":")+1; *d && *d != '"'; d++, p++) { + for(p=pages[j]->url, q=(pages[j]->url-(STRMAX-13-1)), d=c+strlen("\"src\":")+1; *d && *d != '"' && p != q; d++, p++) { if(!strncmp(d, "\\u0026", 6)) { *p = '&'; d+=5; -- cgit v1.2.3