diff options
author | Vincent Sanders <vince@kyllikki.org> | 2016-08-04 00:19:48 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2016-08-04 00:19:48 +0100 |
commit | e8df81fdb3ab94977c42a4a0fed082602308f3c6 (patch) | |
tree | 439977d7b6ae46084841d76f7a5349a1938e77a4 /utils | |
parent | 5a73f0797fe8b3c1350bc57405e789517478bc36 (diff) | |
download | netsurf-e8df81fdb3ab94977c42a4a0fed082602308f3c6.tar.gz netsurf-e8df81fdb3ab94977c42a4a0fed082602308f3c6.tar.bz2 |
add tests for utility string handling
Diffstat (limited to 'utils')
-rw-r--r-- | utils/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/utils.c b/utils/utils.c index 1509a6b09..0ddec8194 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -43,12 +43,14 @@ #include "utils/string.h" #include "utils/utils.h" -/* exported interface documented in utils/utils.h */ +/* exported interface documented in utils/string.h */ char *squash_whitespace(const char *s) { char *c; int i = 0, j = 0; + assert(s != NULL); + c = malloc(strlen(s) + 1); if (c != NULL) { do { @@ -208,7 +210,7 @@ nserror snstrjoin(char **str, size_t *size, char sep, size_t nelm, ...) */ #define BYTESIZE_BUFFER_SIZE 20 -/* exported interface documented in utils/utils.h */ +/* exported interface documented in utils/string.h */ char *human_friendly_bytesize(unsigned long bsize) { static char buffer1[BYTESIZE_BUFFER_SIZE]; static char buffer2[BYTESIZE_BUFFER_SIZE]; |