aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schultz <andreas.schultz@travelping.com>2020-04-07 13:40:36 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-13 17:20:47 +0000
commit8c35542aa4b828e1a4fa31b31bed7294d782151c (patch)
tree3fc900aefb1172fd67e3660936699bac5d36bdbf
parentec50d9ff1ebd2b8f1158145413c22d47848eca58 (diff)
vat: fix static analysis warningstable/1908
replace hand crafted version with existing vector function Type: fix Signed-off-by: Andreas Schultz <andreas.schultz@travelping.com> Change-Id: I94834852469ed316c7bdbd48bb7f479648b2c8e5 (cherry picked from commit 63551351b75d1363b57ed1810b0d7065ca5cd600)
-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 260c32e..71db79e 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);
}