vppapigen: ensure address types are nul terminated
A string generated from format() may not be nul terminated.
Type: fix
Change-Id: I88452e446c3504d70758e9009c65be5466034d92
Signed-off-by: Ole Troan <otroan@employees.org>
diff --git a/src/vppinfra/format.c b/src/vppinfra/format.c
index cf17b8a..642d3e2 100644
--- a/src/vppinfra/format.c
+++ b/src/vppinfra/format.c
@@ -833,6 +833,16 @@
return s;
}
+__clib_export char *
+format_c_string (u8 *s, const char *fmt, ...)
+{
+ va_list args;
+ va_start (args, fmt);
+ s = va_format (s, fmt, &args);
+ va_end (args);
+ vec_add1 (s, '\0');
+ return (char *) s;
+}
/*
* fd.io coding-style-patch-verification: ON