aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vlibmemory/vlib_api_cli.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vlibmemory/vlib_api_cli.c b/src/vlibmemory/vlib_api_cli.c
index 268b682f09a..afd145fe620 100644
--- a/src/vlibmemory/vlib_api_cli.c
+++ b/src/vlibmemory/vlib_api_cli.c
@@ -785,6 +785,10 @@ vl_msg_read_file (FILE *f)
while ((n = fread (buf, 1, bufsize, f)))
vec_add (v, buf, n);
+ /* most callers expect a NULL-terminated C-string */
+ if (v)
+ vec_add1 (v, 0);
+
return v;
}