From 51c41296bca9e06cfa2d53ce3a0837e1a8697b1c Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 13 Jul 2012 18:20:13 +0100 Subject: Ensure text downloaded is null terminated --- getabook.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'getabook.c') 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; } -- cgit v1.2.3