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
|
#endif
|
||||||
if((ret = object_new(++length)) == NULL)
|
if((ret = object_new(++length)) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
snprintf(ret, length, "%s", string);
|
snprintf(ret, length, "%s", (string != NULL) ? string : "");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user