Consider strings empty for string_new_length(NULL)
This commit is contained in:
parent
6d13c18543
commit
6324df6d88
|
@ -108,7 +108,7 @@ String * string_new_length(String const * string, size_t length)
|
|||
#endif
|
||||
if((ret = object_new(++length)) == NULL)
|
||||
return NULL;
|
||||
snprintf(ret, length, "%s", string);
|
||||
snprintf(ret, length, "%s", (string != NULL) ? string : "");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user