[gnome-utils] [logview] Fix uninitialized variable



commit 731213444231504c558216930a0bfe5010a2ea67
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Nov 6 00:52:30 2010 +0100

    [logview] Fix uninitialized variable
    
    If buffer_lines is empty date is never initialized.

 logview/logview-utils.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/logview/logview-utils.c b/logview/logview-utils.c
index cd43f07..793a89d 100644
--- a/logview/logview-utils.c
+++ b/logview/logview-utils.c
@@ -136,7 +136,8 @@ 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;
+  GDate *newdate;
   struct tm *tmptm;
   char *date_string;
   Day *day;
@@ -274,4 +275,4 @@ log_read_dates (const char **buffer_lines, time_t current)
   days = g_slist_sort (days, days_compare);
 
   return days;
-}
\ No newline at end of file
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]