From 28762a84a8599327f68ea06df033c16040fbef03 Mon Sep 17 00:00:00 2001 From: gm10 <13855078+gm10@users.noreply.github.com> Date: Fri, 13 Sep 2019 11:18:43 +0200 Subject: logview: Fix infinite loop parsing logs containing at least one line with a recognized date but not ending with one --- logview/src/logview-utils.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/logview/src/logview-utils.c b/logview/src/logview-utils.c index c74ec399..3c2629e9 100644 --- a/logview/src/logview-utils.c +++ b/logview/src/logview-utils.c @@ -234,10 +234,6 @@ log_read_dates (const char **buffer_lines, time_t current) break; } - if (date_string == NULL && i == n - 1) { - done = TRUE; - } - /* this will set the last line of the "old" log to either: * - "n - 1" if we can't find another date * - the line before the new date else. @@ -267,6 +263,9 @@ log_read_dates (const char **buffer_lines, time_t current) day->timestamp_len = timestamp_len; rangemin = i; rangemax = n - 1; + } else { + /* no other date found */ + done = TRUE; } } } -- cgit v1.2.1