aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:40:18 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:40:18 -0500
commit0892394aa512dd8253c11932c10ffe26e8bc25ad (patch)
tree9dc521b420646492415b0ef4ee1622149534035a /src
parent3acd9c8bd8c28660bc42ebb9e8320b183bff0ff7 (diff)
downloadstasis-0892394aa512dd8253c11932c10ffe26e8bc25ad.tar.gz
Simplify string duplication in normalize_space
Diffstat (limited to 'src')
-rw-r--r--src/lib/core/str.c2
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;
}