forked from auracaster/openocd
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:
+2
-1
@@ -364,7 +364,8 @@ char *alloc_vprintf(const char *fmt, va_list ap)
|
|||||||
/* allocate and make room for terminating zero. */
|
/* allocate and make room for terminating zero. */
|
||||||
/* FIXME: The old version always allocated at least one byte extra and
|
/* 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
|
* 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);
|
string = malloc(len + 2);
|
||||||
if (!string)
|
if (!string)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user