summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-07-30 21:41:23 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-07-30 21:41:23 (GMT)
commit147522bb6118ec82f087208d5caa046f57ff801d (patch)
treefdc57bdc084da094731012092ba137336f75baf3 /tools/lib/h5tools.c
parent4d080e50f6bde9746d2dc12ced01d7f5758965cb (diff)
downloadhdf5-147522bb6118ec82f087208d5caa046f57ff801d.zip
hdf5-147522bb6118ec82f087208d5caa046f57ff801d.tar.gz
hdf5-147522bb6118ec82f087208d5caa046f57ff801d.tar.bz2
[svn-r23948] Bring revisions #23670 - 23713 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r--tools/lib/h5tools.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 5f4227c..3e9c43e 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -527,16 +527,18 @@ h5tools_detect_vlen_str(hid_t tid)
}
}
else if(tclass == H5T_COMPOUND) {
- int i = 0;
- int n = H5Tget_nmembers(tid);
+ unsigned nmembs;
+ int snmembs = H5Tget_nmembers(tid);
+ unsigned u;
- if(n < 0) {
- n = ret;
+ if(snmembs < 0) {
+ ret = FAIL;
goto done;
}
+ nmembs = (unsigned)snmembs;
- for(i = 0; i < n; i++) {
- hid_t mtid = H5Tget_member_type(tid, i);
+ for(u = 0; u < nmembs; u++) {
+ hid_t mtid = H5Tget_member_type(tid, u);
ret = h5tools_detect_vlen_str(mtid);
if((ret == TRUE) || (ret < 0)) {
@@ -1150,6 +1152,8 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
s = *(char**) mem;
if (s != NULL)
size = HDstrlen(s);
+ else
+ H5E_THROW(FAIL, H5E_tools_min_id_g, "NULL string");
}
else {
s = (char *) mem;