diff options
author | George Melikov <[email protected]> | 2021-07-16 23:04:00 +0300 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2021-09-14 12:39:17 -0700 |
commit | f8c2e91db568bb57e8c805a5f947ff263fb87b24 (patch) | |
tree | e8d344cdff63933019c88dbdcc0e2cd750a78ab5 /cmd/zpool_influxdb | |
parent | 056c273939c844246f0944366ffcff92aab0bd92 (diff) |
zpool_influxdb: fix -Werror=stringop-truncation
Use strlcpy instead of problematic strncpy
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Richard Elling <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: George Melikov <[email protected]>
Closes #12344
Diffstat (limited to 'cmd/zpool_influxdb')
-rw-r--r-- | cmd/zpool_influxdb/zpool_influxdb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd/zpool_influxdb/zpool_influxdb.c b/cmd/zpool_influxdb/zpool_influxdb.c index 71ffcb253..35c4770a1 100644 --- a/cmd/zpool_influxdb/zpool_influxdb.c +++ b/cmd/zpool_influxdb/zpool_influxdb.c @@ -683,9 +683,8 @@ print_recursive_stats(stat_printer_f func, nvlist_t *nvroot, if (descend && nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, &child, &children) == 0) { - (void) strncpy(vdev_name, get_vdev_name(nvroot, parent_name), + (void) strlcpy(vdev_name, get_vdev_name(nvroot, parent_name), sizeof (vdev_name)); - vdev_name[sizeof (vdev_name) - 1] = '\0'; for (c = 0; c < children; c++) { print_recursive_stats(func, child[c], pool_name, |