summaryrefslogtreecommitdiff
path: root/getbnbook.c
diff options
context:
space:
mode:
Diffstat (limited to 'getbnbook.c')
-rw-r--r--getbnbook.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/getbnbook.c b/getbnbook.c
index 3b044d6..d228069 100644
--- a/getbnbook.c
+++ b/getbnbook.c
@@ -106,7 +106,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];
/* get cookie */