From c14cc2f4edf8f88ce4bd64f8e6dff1dcccb07a14 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Wed, 19 Mar 2014 20:53:04 +0100 Subject: Make checkAPIs happy strncpy -> g_strlcpy Change-Id: Ib17b6799a762e2e2e65bf7c6dd5a894bfb127c86 Reviewed-on: https://code.wireshark.org/review/746 Reviewed-by: Alexis La Goutte --- wiretap/logcat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'wiretap') diff --git a/wiretap/logcat.c b/wiretap/logcat.c index 5d661ac3e1..5d905219c7 100644 --- a/wiretap/logcat.c +++ b/wiretap/logcat.c @@ -413,7 +413,7 @@ static gboolean logcat_dump_text(wtap_dumper *wdh, str_begin = str_end = log; while (dumper->type != DUMP_LONG && (str_end = strchr(str_begin, '\n'))) { log_part = (gchar *) g_malloc(str_end - str_begin + 1); - strncpy(log_part, str_begin, str_end - str_begin); + g_strlcpy(log_part, str_begin, str_end - str_begin); log_part[str_end - str_begin] = '\0'; str_begin = str_end + 1; @@ -438,7 +438,7 @@ static gboolean logcat_dump_text(wtap_dumper *wdh, if (*str_begin != '\0') { log_part = (gchar *) g_malloc(strlen(str_begin) + 1); - strncpy(log_part, str_begin, strlen(str_begin)); + g_strlcpy(log_part, str_begin, strlen(str_begin)); log_part[strlen(str_begin)] = '\0'; buf = logcat_log(dumper, *datetime, *nanoseconds / 1000000, *pid, *tid, -- cgit v1.2.3