(str_append): Check for NULL.
Showing
1 changed file
with
3 additions
and
1 deletions
... | @@ -132,7 +132,9 @@ static int str_append_n(char** to, const char* from, size_t n) | ... | @@ -132,7 +132,9 @@ static int str_append_n(char** to, const char* from, size_t n) |
132 | } | 132 | } |
133 | static int str_append(char** to, const char* from) | 133 | static int str_append(char** to, const char* from) |
134 | { | 134 | { |
135 | return str_append_n(to, from, strlen(from)); | 135 | if (!from) |
136 | return 0; | ||
137 | return str_append_n(to, from, strlen(from)); | ||
136 | } | 138 | } |
137 | static int str_append_char(char** to, char c) | 139 | static int str_append_char(char** to, char c) |
138 | { | 140 | { | ... | ... |
-
Please register or sign in to post a comment