All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace_event: using strlcpy instead of strncpy
@ 2013-06-20 11:05 Zhao Hongjiang
  0 siblings, 0 replies; only message in thread
From: Zhao Hongjiang @ 2013-06-20 11:05 UTC (permalink / raw)
  To: rostedt; +Cc: fweisbec, mingo, linux-kernel

for NUL terminated string, need alway set '\0' in the end.

Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
---
 samples/trace_events/trace-events-sample.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/samples/trace_events/trace-events-sample.h b/samples/trace_events/trace-events-sample.h
index 6af3732..900f512 100644
--- a/samples/trace_events/trace-events-sample.h
+++ b/samples/trace_events/trace-events-sample.h
@@ -86,7 +86,7 @@ TRACE_EVENT(foo_bar,
 	),
 
 	TP_fast_assign(
-		strncpy(__entry->foo, foo, 10);
+		strlcpy(__entry->foo, foo, 10);
 		__entry->bar	= bar;
 	),
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-20 11:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 11:05 [PATCH] trace_event: using strlcpy instead of strncpy Zhao Hongjiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.