summaryrefslogtreecommitdiff
path: root/wiretap/logcat.c
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-06-23 08:25:15 +0200
committerMichal Labedzki <michal.labedzki@tieto.com>2014-06-30 13:24:36 +0000
commit099bc9342f825a8d970bb888f16a5c0e271686ae (patch)
tree5b5469f9b273efa3b7bdcfa7fd89edfa1ffbb995 /wiretap/logcat.c
parent3b15891115c37b90b7da95b1ec83be9e4fa451f8 (diff)
downloadwireshark-099bc9342f825a8d970bb888f16a5c0e271686ae.tar.gz
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>
Diffstat (limited to 'wiretap/logcat.c')
-rw-r--r--wiretap/logcat.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/wiretap/logcat.c b/wiretap/logcat.c
index 18f9910de5..1f34e0a690 100644
--- a/wiretap/logcat.c
+++ b/wiretap/logcat.c
@@ -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);