summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonsta <[email protected]>2014-11-15 12:06:31 +0300
committerinfirit <[email protected]>2014-12-15 23:14:18 +0100
commit0b62f8fee90654744ad19127cca58017f7a44d78 (patch)
tree593d4e91296be23f8c16335848084bf09b890ebd
parent6d8460ae879f11bbe5cdd4eccf08f7095d92bb5b (diff)
downloadmate-utils-0b62f8fee90654744ad19127cca58017f7a44d78.tar.bz2
mate-utils-0b62f8fee90654744ad19127cca58017f7a44d78.tar.xz
properly NULL-init some vars to avoid logic flaws later
-rw-r--r--logview/logview-utils.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/logview/logview-utils.c b/logview/logview-utils.c
index 3a1e2d07..2b38dc85 100644
--- a/logview/logview-utils.c
+++ b/logview/logview-utils.c
@@ -140,9 +140,9 @@ log_read_dates (const char **buffer_lines, time_t current)
{
int current_year, offsetyear, i, n, rangemin, rangemax, timestamp_len = 0;
GSList *days = NULL;
- GDate *date, *newdate;
+ GDate *date = NULL;
struct tm *tmptm;
- char *date_string;
+ char *date_string = NULL;
Day *day;
gboolean done = FALSE;
@@ -226,7 +226,7 @@ log_read_dates (const char **buffer_lines, time_t current)
/* this means we finished the current day but we're not at the end
* of the buffer: reset the parameters for the next day.
*/
- newdate = NULL;
+ GDate *newdate = NULL;
for (i = day->last_line + 1; buffer_lines[i]; i++) {
if ((newdate = string_get_date (buffer_lines[i], &date_string, &timestamp_len)) != NULL)