summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2021-09-14 20:24:01 (GMT)
committerGitHub <noreply@github.com>2021-09-14 20:24:01 (GMT)
commitcd2ca91875be7d3ee98ab0131c32b9ee072509e5 (patch)
treebc73d8cd6acbe9f2f76dcbcc21374dc0b38e9908 /tools/lib
parent7c973deaf1e602cf165a39860e574a9b5468d164 (diff)
downloadhdf5-cd2ca91875be7d3ee98ab0131c32b9ee072509e5.zip
hdf5-cd2ca91875be7d3ee98ab0131c32b9ee072509e5.tar.gz
hdf5-cd2ca91875be7d3ee98ab0131c32b9ee072509e5.tar.bz2
Fix several warnings (#720)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5tools_str.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 5fcaee6..abc0058 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -258,7 +258,8 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt)
HDassert(temp);
}
- HDstrncpy(temp, str->s + start, n);
+ HDstrncpy(temp, str->s + start, n - 1);
+ temp[n - 1] = '\0';
}
/* Reset the output string and append a formatted version */