summaryrefslogtreecommitdiff
path: root/restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'restore.c')
-rw-r--r--restore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/restore.c b/restore.c
index 26748324..d1ac5420 100644
--- a/restore.c
+++ b/restore.c
@@ -846,7 +846,8 @@ int main(int argc, char **argv)
memset(path_name, 0, 4096);
- strncpy(dir_name, argv[optind + 1], 128);
+ strncpy(dir_name, argv[optind + 1], sizeof dir_name);
+ dir_name[sizeof dir_name - 1] = 0;
/* Strip the trailing / on the dir name */
len = strlen(dir_name);