diff options
author | Nick White <git@njw.me.uk> | 2011-08-21 17:11:54 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2011-08-21 17:11:54 +0100 |
commit | 0fedff7492d97609cdfc5a02a883bdfd693f4dbb (patch) | |
tree | 588bb081366857aedddfabaf13ac149661762155 | |
parent | df8c5735b2d71374385baf288e13d6e88a17840a (diff) |
Set max pages explicitly
-rw-r--r-- | getgbook.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -12,6 +12,7 @@ #define URLMAX 1024 #define STRMAX 1024 +#define MAXPAGES 9999 #define COOKIENUM 5 typedef struct { @@ -121,8 +122,8 @@ int main(int argc, char *argv[]) if(argc == 2) { Page **page; - page = malloc(sizeof(*page) * 1000); - for(i=0; i<1000; i++) page[i] = malloc(sizeof(**page)); + page = malloc(sizeof(*page) * MAXPAGES); + for(i=0; i<MAXPAGES; i++) page[i] = malloc(sizeof(**page)); if(!(totalpages = getpagelist(bookid, page))) { fprintf(stderr, "Could not find pages for %s\n", bookid); return 1; |