Buglet in gtkentry.c



If the current pos is at the end of the text,
gtk_entry_draw_cursor_on_drawable tries to draw the character
following the text (a NUL, or whatever?).

--- gtkentry.c~	Sun Dec 27 22:09:14 1998
+++ gtkentry.c	Fri Jan 01 23:24:40 1999
@@ -1456,10 +1456,11 @@
 			      1, text_area_height - INNER_BORDER);
 	  /* Draw the character under the cursor again */
 
-	  gdk_draw_text_wc (drawable, widget->style->font,
-			    widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
-			    xoffset, yoffset,
-			    entry->text + editable->current_pos, 1);
+	  if (editable->current_pos < entry->text_length)
+	    gdk_draw_text_wc (drawable, widget->style->font,
+			      widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+			      xoffset, yoffset,
+			      entry->text + editable->current_pos, 1);
     }
 



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