From 750ba93c14628206051ca9066ac88a01dfd33f31 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 18 Jul 2018 21:43:27 +0200 Subject: [PATCH] Add note. --- m-string.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/m-string.h b/m-string.h index 4038729d..cf7b6ad3 100644 --- a/m-string.h +++ b/m-string.h @@ -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