vat: fix static analysis warning
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 63551351b7
)
This commit is contained in:

committed by
Andrew Yourtchenko

parent
ec50d9ff1e
commit
8c35542aa4
@@ -94,8 +94,7 @@ vat_json_set_string_copy (vat_json_node_t * json, const u8 * str)
|
|||||||
{
|
{
|
||||||
u8 *ns = NULL;
|
u8 *ns = NULL;
|
||||||
int len = strlen ((const char *) str);
|
int len = strlen ((const char *) str);
|
||||||
vec_validate (ns, len);
|
vec_validate_init_c_string (ns, str, len);
|
||||||
memcpy ((char *) ns, (const char *) str, len + 1);
|
|
||||||
vat_json_set_string (json, ns);
|
vat_json_set_string (json, ns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user