diff options
Diffstat (limited to 'str.h')
| -rw-r--r-- | str.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -40,6 +40,7 @@ Str str_replace_end(Str s, Str a, Str b, Arena *m); /* conversions */ char *str_to_cstr(Str s, Arena *a) { + if (!s.n) return ""; char *r = new_arr(a, char, s.n + 1); memcpy(r, s.s, s.n); r[s.n] = 0; |
