aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-29 13:50:38 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-29 13:50:38 +0100
commit30bb758f4f095812c593294ca7f2ab39b5fb8b39 (patch)
tree1dbabab18616232c886539f6488b4ba6653d3b6f
parent4544d9a0aa23b85ac81be58e4c2f7adc4c3c0cff (diff)
Fix broken check in env_or_defaultv()
-rw-r--r--cbs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cbs.h b/cbs.h
index b8b7ece..72ccef5 100644
--- a/cbs.h
+++ b/cbs.h
@@ -652,7 +652,7 @@ env_or_defaultv(struct strv *sv, const char *s, char **p, size_t n)
p = we.we_wordv;
n = we.we_wordc;
- } else if (!p)
+ } else if (!n || !*p)
return;
sv->buf = bufalloc(sv->buf, sv->len + n, sizeof(*sv->buf));