diff options
author | Nick White <hg@njw.me.uk> | 2011-07-16 15:27:30 +0100 |
---|---|---|
committer | Nick White <hg@njw.me.uk> | 2011-07-16 15:27:30 +0100 |
commit | 21dde74c38f32b4d4243e80e6c7bdf2cf00c9ebe (patch) | |
tree | 78f4ef14e4f9c893ae5059259eb6e3f4e798b31b /getgbook.c | |
parent | 5e8f9f92a2bc1eb1665fdb902afe1111c864b7b5 (diff) |
Update getgbook code a tad
Diffstat (limited to 'getgbook.c')
-rw-r--r-- | getgbook.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -87,7 +87,7 @@ char *getpageurl(char *bookid, char *pg) int main(int argc, char *argv[]) { - char *bookid, *url, pg[12]; + char *bookid, *url, pg[16]; if(argc < 2 || argc > 3) die(usage); @@ -102,14 +102,14 @@ int main(int argc, char *argv[]) } else { if((bookid = getbookid(argv[1])) == NULL) die("Could not find book\n"); - printf("bookid is %s\n", bookid); strncpy(pg, "PA2", 12); if((url = getpageurl(bookid, pg)) == NULL) fprintf(stderr, "Could not find page %s\n", pg); else { - printf("page %s url is %s\n", pg, url); - gettofile(url, "test.png"); + strncat(pg, ".png", 16); + gettofile(url, pg); + printf("Downloaded page %s\n", pg); } } |