summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-08-21 17:11:54 +0100
committerNick White <git@njw.me.uk>2011-08-21 17:11:54 +0100
commit0fedff7492d97609cdfc5a02a883bdfd693f4dbb (patch)
tree588bb081366857aedddfabaf13ac149661762155
parentdf8c5735b2d71374385baf288e13d6e88a17840a (diff)
Set max pages explicitly
-rw-r--r--getgbook.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/getgbook.c b/getgbook.c
index 62faf46..e60316f 100644
--- a/getgbook.c
+++ b/getgbook.c
@@ -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;