diff options
author | Richard Yao <[email protected]> | 2014-04-22 20:25:39 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-09-23 10:32:21 -0700 |
commit | 928ee9fe184572a50e686b0c5173edb1b538c627 (patch) | |
tree | 6ed79dd1aebecdbf251756e220ca4afbc353d446 /lib/libzfs | |
parent | a05dfd0028fa0c49dec3ceea48995b4d6fe274ca (diff) |
Properly NULL terminate string in zfs_strcmp_pathname
The utility cppcheck caught this.
Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #2330
Diffstat (limited to 'lib/libzfs')
-rw-r--r-- | lib/libzfs/libzfs_util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index d029b61e7..7f947c186 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -962,7 +962,7 @@ zfs_strcmp_pathname(char *name, char *cmp, int wholedisk) if (name[0] != '/') return (zfs_strcmp_shortname(name, cmp_name, wholedisk)); - strncpy(path_name, name, MAXPATHLEN); + (void) strlcpy(path_name, name, MAXPATHLEN); path_len = strlen(path_name); cmp_len = strlen(cmp_name); |