helper: log: document the last user of hack in alloc_vprintf()

Apparently the last user of the hack in alloc_vprintf() is the
code in log_vprintf_lf().

Document it for future rework.

Change-Id: I6b69f8b7f3feb93e5daa9649c4122ec12e22d84f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9317
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2025-11-02 16:51:36 +01:00
parent cb6b803947
commit 58eb7e31a6
+2 -1
View File
@@ -364,7 +364,8 @@ char *alloc_vprintf(const char *fmt, va_list ap)
/* allocate and make room for terminating zero. */
/* FIXME: The old version always allocated at least one byte extra and
* other code depend on that. They should be probably be fixed, but for
* now reserve the extra byte. */
* now reserve the extra byte. Apparently the last user of such hack is
* log_vprintf_lf() that adds a trailing newline. */
string = malloc(len + 2);
if (!string)
return NULL;