lib/trace: replace strncpy with snprintf

Change-Id: I07fe37a33e336217fbd31748c60337df7399fe1b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
Ziye Yang 2017-03-28 15:08:06 +08:00 committed by Daniel Verkamp
parent 608f52ebbf
commit 7f11df67ea

View File

@ -263,7 +263,7 @@ spdk_trace_register_description(const char *name, const char *short_name,
tpoint->new_object = new_object;
tpoint->arg1_is_ptr = arg1_is_ptr;
tpoint->arg1_is_alias = arg1_is_alias;
strncpy(tpoint->arg1_name, arg1_name, sizeof(tpoint->arg1_name));
snprintf(tpoint->arg1_name, sizeof(tpoint->arg1_name), "%s", arg1_name);
}
void