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 db0d1e830a3a66ea7d2eb6e7086210c330db43dd..8aca0c1e073aa44cfd423bd16c159d6f3303c297 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 69f87ac28499a419529801a7520d8d2844269383..2549f54c8175f009c44df7c7a1cc896f7505ffbd 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 9412f2270857fab4fa19d2335138c817d5fca635..39ce93654903ab92ec6c235d6331737fb6370814 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));