Fix issue for string_strim if string was empty and not allocated.
This commit is contained in:
1 parent
34d56c54c8
commit
354327e40b
1 file changed
+2
-1
+2
-1
@@ -782,7 +782,8 @@ string_strim(string_t v, const char charac[])
|
||||
while (size > 0 && stringi_strim_char(b[size-1], charac))
|
||||
size --;
|
||||
if (size == 0) {
|
||||
v->ptr[0] = 0;
|
||||
if (v->ptr != NULL)
|
||||
v->ptr[0] = 0;
|
||||
v->size = size;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user