Report an error upon string_new_format(NULL)
This commit is contained in:
parent
bd413de612
commit
0ad485a8c3
|
@ -76,6 +76,11 @@ String * string_new_format(String const * format, ...)
|
||||||
int len;
|
int len;
|
||||||
size_t s;
|
size_t s;
|
||||||
|
|
||||||
|
if(format == NULL)
|
||||||
|
{
|
||||||
|
error_set_code(-EINVAL, "%s", strerror(EINVAL));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
len = vsnprintf(NULL, 0, format, ap);
|
len = vsnprintf(NULL, 0, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user