summaryrefslogtreecommitdiff
path: root/getbnbook.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 /getbnbook.c
parent8f03147275f2522fa9d5dd16ed3e875dfffe515e (diff)
Ensure text downloaded is null terminated
Diffstat (limited to 'getbnbook.c')
-rw-r--r--getbnbook.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/getbnbook.c b/getbnbook.c
index d6f06b8..dba1856 100644
--- a/getbnbook.c
+++ b/getbnbook.c
@@ -39,7 +39,7 @@ int getpagelist()
snprintf(url, URLMAX, "/DigBooks/viewer/bookviewmanager.aspx?op=getbookinfo&ean=%s", bookid);
- if(!get("search2.barnesandnoble.com", url, cookies, NULL, &buf))
+ if(!get("search2.barnesandnoble.com", url, cookies, NULL, &buf, 1))
return 1;
/* find page url structure */
@@ -79,7 +79,7 @@ int getpage(int pagenum)
s=strchr(urlpath+7, '/');
snprintf(pageurl, STRMAX, s, pagenum);
- if(gettofile("search2.barnesandnoble.com", pageurl, cookies, NULL, path)) {
+ if(gettofile("search2.barnesandnoble.com", pageurl, cookies, NULL, path, 0)) {
fprintf(stderr, "%d failed\n", pagenum);
return 1;
}
@@ -111,7 +111,7 @@ int main(int argc, char *argv[])
bookdir = argv[argc-1];
/* get cookie */
- if(get("www.barnesandnoble.com", "/", NULL, cookies, &tmp))
+ if(get("www.barnesandnoble.com", "/", NULL, cookies, &tmp, 0))
free(tmp);
if(getpagelist()) {