forked from osmocom/wireshark
Logcat: Remove commented code
"g_strlcpy" guarante that "dest" to be null-terminated. Also cosmetic change from file_subtype to encap. Change-Id: If188a08cf34dd9def4203404962571c273740636 Reviewed-on: https://code.wireshark.org/review/2718 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
This commit is contained in:
parent
3b15891115
commit
099bc9342f
|
@ -320,8 +320,8 @@ gboolean logcat_binary_dump_open(wtap_dumper *wdh, int *err)
|
|||
wdh->subtype_write = logcat_binary_dump;
|
||||
wdh->subtype_close = NULL;
|
||||
|
||||
switch (wdh->file_type_subtype) {
|
||||
case WTAP_FILE_TYPE_SUBTYPE_LOGCAT:
|
||||
switch (wdh->encap) {
|
||||
case WTAP_ENCAP_LOGCAT:
|
||||
wdh->tsprecision = WTAP_FILE_TSPREC_USEC;
|
||||
break;
|
||||
|
||||
|
@ -383,9 +383,7 @@ static gboolean logcat_dump_text(wtap_dumper *wdh,
|
|||
while (dumper->type != DUMP_LONG && (str_end = strchr(str_begin, '\n'))) {
|
||||
log_part = (gchar *) g_malloc(str_end - str_begin + 1);
|
||||
g_strlcpy(log_part, str_begin, str_end - str_begin + 1);
|
||||
#if 0
|
||||
log_part[str_end - str_begin] = '\0';
|
||||
#endif
|
||||
|
||||
str_begin = str_end + 1;
|
||||
|
||||
buf = logcat_log(dumper, *datetime, *nanoseconds / 1000000, *pid, *tid,
|
||||
|
@ -410,9 +408,6 @@ static gboolean logcat_dump_text(wtap_dumper *wdh,
|
|||
if (*str_begin != '\0') {
|
||||
log_part = (gchar *) g_malloc(strlen(str_begin) + 1);
|
||||
g_strlcpy(log_part, str_begin, strlen(str_begin) + 1);
|
||||
#if 0
|
||||
log_part[strlen(str_begin)] = '\0';
|
||||
#endif
|
||||
|
||||
buf = logcat_log(dumper, *datetime, *nanoseconds / 1000000, *pid, *tid,
|
||||
priority, tag, log_part);
|
||||
|
|
Loading…
Reference in New Issue