summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vat/json_format.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vat/json_format.h b/src/vat/json_format.h
index d2fab9020b3..260c32ede25 100644
--- a/src/vat/json_format.h
+++ b/src/vat/json_format.h
@@ -95,8 +95,7 @@ vat_json_set_string_copy (vat_json_node_t * json, const u8 * str)
u8 *ns = NULL;
int len = strlen ((const char *) str);
vec_validate (ns, len);
- strncpy ((char *) ns, (const char *) str, len + 1);
- vec_add1 (ns, '\0');
+ memcpy ((char *) ns, (const char *) str, len + 1);
vat_json_set_string (json, ns);
}