diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2020-03-27 16:58:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 16:58:25 -0400 |
commit | 5048b9046afe0b48377a9862da9148165f7a0890 (patch) | |
tree | e0ca2fadb35cec1aea6ca9fad885fe9ba9d823a9 /lib/str.c | |
parent | 85e3866192ae8436620ec27e5f659e4da0761e5d (diff) | |
parent | d0095b6d304bba14d0f93185939ce864843fa152 (diff) | |
download | spmc-5048b9046afe0b48377a9862da9148165f7a0890.tar.gz |
Merge pull request #6 from jhunkeler/test-normalize-space
Test normalize space
Diffstat (limited to 'lib/str.c')
-rw-r--r-- | lib/str.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -705,6 +705,11 @@ char *normalize_space(char *s) { int add_whitespace = 0; char *result = s; char *tmp; + + if (s == NULL) { + return NULL; + } + if ((tmp = calloc(strlen(s) + 1, sizeof(char))) == NULL) { perror("could not allocate memory for temporary string"); return NULL; |