summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgm10 <[email protected]>2019-09-13 11:18:43 +0200
committerraveit65 <[email protected]>2019-09-26 14:20:07 +0200
commit28762a84a8599327f68ea06df033c16040fbef03 (patch)
tree308e741a130522da3dc83ad9c2a17fa17d885bc7
parentfce3152f3ca1810251374837772e4f1505d0c9b5 (diff)
downloadmate-utils-28762a84a8599327f68ea06df033c16040fbef03.tar.bz2
mate-utils-28762a84a8599327f68ea06df033c16040fbef03.tar.xz
logview: Fix infinite loop parsing logs containing at least one line with a recognized date but not ending with one
-rw-r--r--logview/src/logview-utils.c7
1 files 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;
}
}
}