summaryrefslogtreecommitdiff
path: root/getabook.c
diff options
context:
space:
mode:
Diffstat (limited to 'getabook.c')
-rw-r--r--getabook.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/getabook.c b/getabook.c
index 81c1dfc..2712cc8 100644
--- a/getabook.c
+++ b/getabook.c
@@ -158,7 +158,8 @@ int main(int argc, char *argv[])
return 1;
}
- strncpy(bookid, argv[argc-1], STRMAX);
+ strncpy(bookid, argv[argc-1], STRMAX-1);
+ bookid[STRMAX-1] = '\0';
bookdir = argv[argc-1];
pages = malloc(sizeof(*pages) * MAXPAGES);