Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
misc: strcpy be gone
[vpp.git]
/
src
/
vpp
/
api
/
json_format.h
diff --git
a/src/vpp/api/json_format.h
b/src/vpp/api/json_format.h
index
154fb3d
..
6321797
100644
(file)
--- a/
src/vpp/api/json_format.h
+++ b/
src/vpp/api/json_format.h
@@
-94,7
+94,7
@@
vat_json_set_string_copy (vat_json_node_t * json, const u8 * str)
{
u8 *ns = NULL;
vec_validate (ns, strlen ((const char *) str));
{
u8 *ns = NULL;
vec_validate (ns, strlen ((const char *) str));
- str
cpy ((char *) ns, (const char *) str
);
+ str
ncpy ((char *) ns, (const char *) str, vec_len (ns)
);
vec_add1 (ns, '\0');
vat_json_set_string (json, ns);
}
vec_add1 (ns, '\0');
vat_json_set_string (json, ns);
}