From c2892e23ef3aa063812714323b5e8f9ebe0fc318 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sat, 16 Jul 2011 23:24:57 +0100 Subject: Clean up pointer arithmetic --- Makefile | 2 +- getgbook.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 906a92b..d9ca4fb 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ all: getgbook .c.o: @echo CC $< - @$(CC) -c -g -Wall $(CFLAGS) $< + @$(CC) -c -g -Wall -Werror $(CFLAGS) $< $(OBJ): util.c diff --git a/getgbook.c b/getgbook.c index a169883..cf16aae 100644 --- a/getgbook.c +++ b/getgbook.c @@ -63,7 +63,7 @@ int gettotalpages(char *bookid) if((c = strstr(buf," pages")) == NULL) return 0; - while(*c && *c != '>') *c--; + while(*c && *c != '>') c--; sscanf(c+1, "%d ", &total); return total; @@ -94,7 +94,7 @@ Page *getpagedetail(char *bookid, char *pg) free(buf); return page; } - for(p=page->url, d=c+strlen(m)+8; *d && *d != '"'; *d++, *p++) { + for(p=page->url, d=c+strlen(m)+8; *d && *d != '"'; d++, p++) { if(!strncmp(d, "\\u0026", 6)) { *p = '&'; d+=5; @@ -103,7 +103,7 @@ Page *getpagedetail(char *bookid, char *pg) } *p = '\0'; - for(; *d; *d++) { + for(; *d; d++) { if(*d == '}') { break; } -- cgit v1.2.3