summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/h5import/h5import.c4
-rw-r--r--tools/src/h5ls/h5ls.c2
2 files changed, 2 insertions, 4 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index b11fe7f..4a642e0 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -3735,8 +3735,8 @@ static int getExternalFilename(struct Input *in, FILE *strm)
return (-1);
}
- in->externFilename = (char *) HDmalloc ((size_t) (HDstrlen(temp)) * sizeof(char));
- (void) HDstrcpy(in->externFilename, temp);
+ in->externFilename = (char *) HDmalloc ((size_t) (HDstrlen(temp) + 1) * sizeof(char));
+ (void) HDstrncpy(in->externFilename, temp, HDstrlen(temp) + 1);
return (0);
}
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index fef7aa9..e239cbc 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -1313,7 +1313,6 @@ dump_dataset_values(hid_t dset)
hid_t space = H5I_INVALID_HID;
hsize_t total_size[H5S_MAX_RANK];
int ndims;
- size_t i;
char string_prefix[64];
static char fmt_double[16];
static char fmt_float[16];
@@ -1481,7 +1480,6 @@ dump_attribute_values(hid_t attr)
hid_t space = H5I_INVALID_HID;
hsize_t total_size[H5S_MAX_RANK];
int ndims;
- size_t i;
char string_prefix[64];
static char fmt_double[16];
static char fmt_float[16];