summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-06-20 22:02:17 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-06-20 22:02:17 (GMT)
commit125e2a0a9d8beb22ab06e3300624df24a1192214 (patch)
tree13f763fa2a81ef6a10657141486e79c6b90bc810 /tools
parente71411f9cf484800ce95847687229f2f280877b9 (diff)
downloadhdf5-125e2a0a9d8beb22ab06e3300624df24a1192214.zip
hdf5-125e2a0a9d8beb22ab06e3300624df24a1192214.tar.gz
hdf5-125e2a0a9d8beb22ab06e3300624df24a1192214.tar.bz2
[svn-r23800] Added the HD prefix to the system functions used in the h5tools_str_replace function.
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools_str.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 5820b28..9bacd19 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -1395,24 +1395,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);
}