Fixed a crash introduced in 0.8.0claws5 when log is cut under
authorMelvin Hadasht <melvin.hadasht@free.fr>
Fri, 26 Jul 2002 13:03:56 +0000 (13:03 +0000)
committerMelvin Hadasht <melvin.hadasht@free.fr>
Fri, 26 Jul 2002 13:03:56 +0000 (13:03 +0000)
80 characters.

ChangeLog.claws
configure.in
src/logwindow.c

index db0d1e8..8aca0c1 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-26 [melvin]    0.8.0claws17
+
+       * src/logwindow.c
+               Fixed a crash introduced in 0.8.0claws5 when log is 
+               cut under 80 characters.
+
 2002-07-26 [paul]      0.8.0claws16
 
        * sync with 0.8.1cvs1
index 69f87ac..2549f54 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws16
+EXTRA_VERSION=claws17
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 9412f22..39ce936 100644 (file)
@@ -165,7 +165,6 @@ void log_window_clear(GtkWidget *text)
 {
         guint length;
        guint point;
-       gchar *str;
        
        length = gtk_text_get_length (GTK_TEXT (text));
        debug_print(_("Log window length: %u\n"), length);
@@ -177,13 +176,16 @@ void log_window_clear(GtkWidget *text)
                        point = length - prefs_common.loglength;
                
                do {
-                       str = gtk_editable_get_chars (GTK_EDITABLE (text),
-                                       point, point + LOG_AVG_LINE_LEN);
-                       if ((lf = strchr(str, '\n')) != NULL)
-                               point += lf - str;
-                       else 
-                               point += LOG_AVG_LINE_LEN;
-                       g_free(str);
+                       gchar *str;
+                       if ((str = gtk_editable_get_chars (GTK_EDITABLE (text),
+                                       point, point + LOG_AVG_LINE_LEN))) {
+                               if ((lf = strchr(str, '\n')) != NULL)
+                                       point += lf - str;
+                               else 
+                                       point += strlen(str);
+                               g_free(str);
+                       } else
+                               break;
                } while (lf == NULL);
                                
                gtk_text_freeze (GTK_TEXT (text));