diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2015-06-19 15:57:38 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2015-06-19 15:57:38 (GMT) |
commit | 48e1bbb0f87c6712189f82a7c5d8835a87d21ee2 (patch) | |
tree | 5f22350f85d053d8137be356dafa8b824122cd44 /tools/lib/h5tools_str.c | |
parent | c614e178e32188bde97f1cf692bb2c15d97135df (diff) | |
download | hdf5-48e1bbb0f87c6712189f82a7c5d8835a87d21ee2.zip hdf5-48e1bbb0f87c6712189f82a7c5d8835a87d21ee2.tar.gz hdf5-48e1bbb0f87c6712189f82a7c5d8835a87d21ee2.tar.bz2 |
[svn-r27252] Fix whitespace
Diffstat (limited to 'tools/lib/h5tools_str.c')
-rw-r--r-- | tools/lib/h5tools_str.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index b945847..470620f 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1386,23 +1386,23 @@ h5tools_str_is_zero(const void *_mem, size_t size) char * h5tools_str_replace ( const char *string, const char *substr, const char *replacement ) { - char *tok = NULL; - char *newstr = NULL; - char *oldstr = NULL; - char *head = NULL; - - if ( substr == NULL || replacement == NULL ) - return HDstrdup (string); - - newstr = HDstrdup (string); - head = newstr; - while ( (tok = HDstrstr ( head, substr ))){ - oldstr = newstr; - newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); + char *tok = NULL; + char *newstr = NULL; + char *oldstr = NULL; + char *head = NULL; + + if ( substr == NULL || replacement == NULL ) + return HDstrdup (string); + + newstr = HDstrdup (string); + head = newstr; + while ( (tok = HDstrstr ( head, substr ))){ + oldstr = newstr; + newstr = HDmalloc ( HDstrlen ( oldstr ) - HDstrlen ( substr ) + HDstrlen ( replacement ) + 1 ); if ( newstr == NULL ){ - HDfree (oldstr); - return NULL; + HDfree (oldstr); + return NULL; } HDmemcpy ( newstr, oldstr, tok - oldstr ); HDmemcpy ( newstr + (tok - oldstr), replacement, HDstrlen ( replacement ) ); |