summaryrefslogtreecommitdiff
path: root/getabook.c
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2012-07-13 18:20:13 +0100
committerNick White <git@njw.me.uk>2012-07-13 18:20:13 +0100
commit51c41296bca9e06cfa2d53ce3a0837e1a8697b1c (patch)
treea77825784861c85e8509f25cc9d6de9d619b26f6 /getabook.c
parent8f03147275f2522fa9d5dd16ed3e875dfffe515e (diff)
Ensure text downloaded is null terminated
Diffstat (limited to 'getabook.c')
-rw-r--r--getabook.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/getabook.c b/getabook.c
index d923029..8892394 100644
--- a/getabook.c
+++ b/getabook.c
@@ -73,7 +73,7 @@ int getpagelist()
snprintf(url, URLMAX, "/gp/search-inside/service-data?method=getBookData&asin=%s", bookid);
- if(!get("www.amazon.com", url, NULL, NULL, &buf))
+ if(!get("www.amazon.com", url, NULL, NULL, &buf, 1))
return 1;
/* amazon have a canonical asin, which is needed to get all available pages */
@@ -114,7 +114,7 @@ int getpageurls(int pagenum) {
strncpy(url, "/gp/search-inside/service-data", URLMAX);
snprintf(query, URLMAX, "method=goToPage&asin=%s&page=%d", bookid, pagenum);
- if(!post("www.amazon.com", url, NULL, NULL, query, &buf))
+ if(!post("www.amazon.com", url, NULL, NULL, query, &buf, 1))
return 1;
fillurls(buf);
@@ -133,7 +133,7 @@ int getpage(Page *page)
return 1;
}
- if(gettofile("sitb-images.amazon.com", page->url, NULL, NULL, path)) {
+ if(gettofile("sitb-images.amazon.com", page->url, NULL, NULL, path, 0)) {
fprintf(stderr, "%d failed\n", page->num);
return 1;
}