diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2017-08-02 19:51:08 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2017-08-02 19:51:08 (GMT) |
commit | df099c726400d67b8be071d59108f3fc11a4d23d (patch) | |
tree | 758ddc9ebea908c3cb990acfeec73cf851a6ebd2 /tools/h5dump/h5dump_xml.c | |
parent | cd0e71d998898a29b0d8291497faad4c8ab979de (diff) | |
download | hdf5-df099c726400d67b8be071d59108f3fc11a4d23d.zip hdf5-df099c726400d67b8be071d59108f3fc11a4d23d.tar.gz hdf5-df099c726400d67b8be071d59108f3fc11a4d23d.tar.bz2 |
HDFFV-10256 correct len of string copy to the len of esc string
Merge from develop
Diffstat (limited to 'tools/h5dump/h5dump_xml.c')
-rw-r--r-- | tools/h5dump/h5dump_xml.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 8f6dd86..ee897ae 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -10,8 +10,6 @@ * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include <stdio.h> -#include <stdlib.h> #include "H5private.h" #include "h5tools.h" @@ -781,20 +779,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; |