diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-12 16:40:18 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-02-12 16:40:18 -0500 |
commit | 0892394aa512dd8253c11932c10ffe26e8bc25ad (patch) | |
tree | 9dc521b420646492415b0ef4ee1622149534035a /src | |
parent | 3acd9c8bd8c28660bc42ebb9e8320b183bff0ff7 (diff) | |
download | stasis-0892394aa512dd8253c11932c10ffe26e8bc25ad.tar.gz |
Simplify string duplication in normalize_space
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/core/str.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/core/str.c b/src/lib/core/str.c index d774e72..6457afe 100644 --- a/src/lib/core/str.c +++ b/src/lib/core/str.c @@ -526,7 +526,7 @@ char *normalize_space(char *s) { return NULL; } - if ((tmp = calloc(strlen(s) + 1, sizeof(char))) == NULL) { + if (!(tmp = strdup(s))) { perror("could not allocate memory for temporary string"); return NULL; } |