Add note.
This commit is contained in:
1 parent
18be930507
commit
750ba93c14
1 file changed
+2
@@ -621,6 +621,8 @@ string_cat_printf (string_t v, const char format[], ...)
|
|||||||
va_list args;
|
va_list args;
|
||||||
int size;
|
int size;
|
||||||
va_start (args, format);
|
va_start (args, format);
|
||||||
|
/* If v->ptr is NULL, then v->alloc-v->size is 0, and the
|
||||||
|
function shall does nothing. TBC if not undefined behavior however */
|
||||||
size = vsnprintf (&v->ptr[v->size], v->alloc - v->size, format, args);
|
size = vsnprintf (&v->ptr[v->size], v->alloc - v->size, format, args);
|
||||||
if (size > 0 && (v->size+(size_t)size+1 >= v->alloc) ) {
|
if (size > 0 && (v->size+(size_t)size+1 >= v->alloc) ) {
|
||||||
// We have to realloc our string to fit the needed size
|
// We have to realloc our string to fit the needed size
|
||||||
|
|||||||
Reference in new issue
Block a user