Add note.

This commit is contained in:
Patrick Pelissier committed 2018-07-18 21:43:27 +02:00
1 parent 18be930507
commit 750ba93c14
1 file changed
+2
+2
View File
@@ -621,6 +621,8 @@ string_cat_printf (string_t v, const char format[], ...)
va_list args;
int size;
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);
if (size > 0 && (v->size+(size_t)size+1 >= v->alloc) ) {
// We have to realloc our string to fit the needed size