summaryrefslogtreecommitdiffstats
path: root/tools/src/h5dump
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-08-01 18:36:32 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-08-01 18:36:51 (GMT)
commit538e9103681290b6a30d14fc94f50e499b2d11d3 (patch)
tree79f8d3715844fda1726180f7aad8211bc1692d5a /tools/src/h5dump
parent464926f2a3adf3ef1c1e3ae60105544f08ff1e51 (diff)
downloadhdf5-538e9103681290b6a30d14fc94f50e499b2d11d3.zip
hdf5-538e9103681290b6a30d14fc94f50e499b2d11d3.tar.gz
hdf5-538e9103681290b6a30d14fc94f50e499b2d11d3.tar.bz2
HDFFV-10256 correct len of string copy to the len of esc string
Diffstat (limited to 'tools/src/h5dump')
-rw-r--r--tools/src/h5dump/h5dump_xml.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c
index bb0fd7a..49d4f96 100644
--- a/tools/src/h5dump/h5dump_xml.c
+++ b/tools/src/h5dump/h5dump_xml.c
@@ -780,20 +780,20 @@ xml_escape_the_string(const char *str, int slen)
esc_len = 1;
}
else if (*cp == '\'') {
- HDstrncpy(ncp, apos, ncp_len);
esc_len = HDstrlen(apos);
+ HDstrncpy(ncp, apos, esc_len);
}
else if (*cp == '<') {
- HDstrncpy(ncp, lt, ncp_len);
esc_len = HDstrlen(lt);
+ HDstrncpy(ncp, lt, esc_len);
}
else if (*cp == '>') {
- HDstrncpy(ncp, gt, ncp_len);
esc_len = HDstrlen(gt);
+ HDstrncpy(ncp, gt, esc_len);
}
else if (*cp == '&') {
- HDstrncpy(ncp, amp, ncp_len);
esc_len = HDstrlen(amp);
+ HDstrncpy(ncp, amp, esc_len);
}
else {
*ncp = *cp;