X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvat%2Fjson_format.h;h=71db79eacf56e4211cce8b9667864fe5b781d905;hb=9a8d3d71071ca82c139dae5aa45cb0d4620ca9e3;hp=260c32ede25fbc2be40d6c615fd448f55791b0e6;hpb=b1bb513792fecd735effebbd07d867ea93adc9f6;p=vpp.git diff --git a/src/vat/json_format.h b/src/vat/json_format.h index 260c32ede25..71db79eacf5 100644 --- a/src/vat/json_format.h +++ b/src/vat/json_format.h @@ -94,8 +94,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); - memcpy ((char *) ns, (const char *) str, len + 1); + vec_validate_init_c_string (ns, str, len); vat_json_set_string (json, ns); }