Make checkAPIs happy

strncpy -> g_strlcpy

Change-Id: Ib17b6799a762e2e2e65bf7c6dd5a894bfb127c86
Reviewed-on: https://code.wireshark.org/review/746
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Alexis La Goutte 2014-03-19 20:53:04 +01:00
parent 0f51f78608
commit c14cc2f4ed
1 changed files with 2 additions and 2 deletions

View File

@ -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,