[PATCH] trace_event: using strlcpy instead of strncpy

From: Zhao Hongjiang
Date: Thu Jun 20 2013 - 07:08:54 EST


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

Signed-off-by: Zhao Hongjiang <zhaohongjiang@xxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/