summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-01-14 16:26:22 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-01-14 16:26:22 (GMT)
commit7a775b6c59d2b935c5ce2ab58a4895130055fb50 (patch)
treee2d493bb310342883b2478830340191a25a86382
parent4b9482eaee456111a6bdb57db2f00a9bf069fcd3 (diff)
downloadhdf5-7a775b6c59d2b935c5ce2ab58a4895130055fb50.zip
hdf5-7a775b6c59d2b935c5ce2ab58a4895130055fb50.tar.gz
hdf5-7a775b6c59d2b935c5ce2ab58a4895130055fb50.tar.bz2
[svn-r23158] HDFFV-8169: h5dump incorrectly dumps a string into a binary file
Tested: local linux
-rw-r--r--tools/lib/h5tools.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 7b6098d..3e29cbd 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1133,7 +1133,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
}
for (i = 0; i < size && (s[i] || pad != H5T_STR_NULLTERM); i++) {
HDmemcpy(&tempuchar, &s[i], sizeof(unsigned char));
- if (1 != HDfwrite(&tempuchar, size, 1, stream))
+ if (1 != HDfwrite(&tempuchar, sizeof(unsigned char), 1, stream))
H5E_THROW(FAIL, H5E_tools_min_id_g, "fwrite failed");
} /* i */
} /* for (block_index = 0; block_index < block_nelmts; block_index++) */