Return a negative value to indicate truncation.
If the maximum availalbe buffer size is zero, no data can be written (not even the NULL terminator), and a negative values should be returned to indicate truncation.
This commit is contained in:
parent
dad451f6f9
commit
f4eeb7745e
@ -50,7 +50,7 @@ l_vsnprintf (char *str, size_t size, const char *format, va_list ap)
|
||||
int n;
|
||||
|
||||
if (size == 0)
|
||||
return 0;
|
||||
return -1;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user