diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-31 23:49:47 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-31 23:49:47 (GMT) |
commit | e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18 (patch) | |
tree | e3b6e42b691c6ddf7ef9714c132cb922ae28b096 /tools/lib | |
parent | 3146ddb5c2fc5e57b72eb2ecce697a7016f92b3a (diff) | |
download | hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.zip hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.tar.gz hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.tar.bz2 |
[svn-r23959] Bring revisions #23745 - 23862 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools_dump.c | 1 | ||||
-rw-r--r-- | tools/lib/h5tools_str.c | 20 |
2 files changed, 9 insertions, 12 deletions
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 705dcf5..f3a9771 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -638,7 +638,6 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, { HERROR(H5E_tools_g, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); HGOTO_DONE(dimension_break); - //HGOTO_ERROR(dimension_break, H5E_tools_min_id_g, "Could not allocate buffer for ptdata"); } if(H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b46dc18..ee61ac7 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -643,8 +643,6 @@ h5tools_str_indent(h5tools_str_t *str, const h5tool_format_t *info, for (i = 0; i < indentlevel; i++) { h5tools_str_append(str, "%s", OPT(info->line_indent, "")); } - -// ctx->need_prefix = 0; } /*------------------------------------------------------------------------- @@ -1462,24 +1460,24 @@ h5tools_str_replace ( const char *string, const char *substr, const char *replac char *head = NULL; if ( substr == NULL || replacement == NULL ) - return strdup (string); + return HDstrdup (string); - newstr = strdup (string); + newstr = HDstrdup (string); head = newstr; - while ( (tok = strstr ( head, substr ))){ + while ( (tok = HDstrstr ( head, substr ))){ oldstr = newstr; - newstr = HDmalloc ( strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) + 1 ); + newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); if ( newstr == NULL ){ HDfree (oldstr); return NULL; } - memcpy ( newstr, oldstr, tok - oldstr ); - memcpy ( newstr + (tok - oldstr), replacement, strlen ( replacement ) ); - memcpy ( newstr + (tok - oldstr) + strlen( replacement ), tok + strlen ( substr ), strlen ( oldstr ) - strlen ( substr ) - ( tok - oldstr ) ); - memset ( newstr + strlen ( oldstr ) - strlen ( substr ) + strlen ( replacement ) , 0, 1 ); + HDmemcpy ( newstr, oldstr, tok - oldstr ); + HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) ); + HDmemcpy ( newstr + (tok - oldstr) + HDstrlen( replacement ), tok + HDstrlen ( substr ), HDstrlen ( oldstr ) - HDstrlen ( substr ) - ( tok - oldstr ) ); + HDmemset ( newstr + HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) , 0, 1 ); /* move back head right after the last replacement */ - head = newstr + (tok - oldstr) + strlen( replacement ); + head = newstr + (tok - oldstr) + HDstrlen( replacement ); HDfree (oldstr); } |