trace_event: using strlcpy instead of strncpy
PATCH 1/1 trace_event: using strlcpy instead of strncpy
for NUL terminated string, need alway set '\0' in the end.
Signed-off-by Zhao Hongjiang <[email protected]>
--- samples/trace_events/trace-events-sample.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
samples/trace_events/trace-events-sample.h +1 -1
@@ -86,7 +86,7 @@ TRACE_EVENT(foo_bar, ), TP_fast_assign( - strncpy(__entry->foo, foo, 10); + strlcpy(__entry->foo, foo, 10); __entry->bar = bar; ),
Signature · 1 line
1.7.1