summaryrefslogtreecommitdiff
path: root/btrfsctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'btrfsctl.c')
-rw-r--r--btrfsctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/btrfsctl.c b/btrfsctl.c
index d45e2a76..518684c6 100644
--- a/btrfsctl.c
+++ b/btrfsctl.c
@@ -241,9 +241,10 @@ int main(int ac, char **av)
fd = open_file_or_dir(fname);
}
- if (name)
+ if (name) {
strncpy(args.name, name, BTRFS_PATH_NAME_MAX + 1);
- else
+ args.name[BTRFS_PATH_NAME_MAX] = 0;
+ } else
args.name[0] = '\0';
if (command == BTRFS_IOC_SNAP_CREATE) {