Resend - Unitialised EDITSTATE

jeffl jeffl at defcen.gov.au
Mon May 24 08:01:34 CDT 2004


People, when trying to run DebugApiSpy.exe in encounter a divide by
zero. It seems there is a circumstance where the EDITSTATE block can be
unitialised.  I have not found this yet and I am not sure how to track
it down.  This patch fixes the instance where the problem occurs for me.
    There are other instances where a divide by zero could occur.

Jeff Latimer

-------------- next part --------------
Index: edit.c
===================================================================
RCS file: /home/wine/wine/controls/edit.c,v
retrieving revision 1.131
diff -u -u -r1.131 edit.c
--- edit.c	7 May 2004 00:40:18 -0000	1.131
+++ edit.c	21 May 2004 07:04:44 -0000
@@ -2159,6 +2159,11 @@
 	if (es->style & ES_MULTILINE)
 	{
 	    INT fw, vlc, max_x_offset, max_y_offset;
+	    if (!es->line_height)
+	    {
+		FIXME("EDITSTATE es->line_height=%d, setting to 1\n", es->line_height);
+		es->line_height = 1;		/* for some reason is unitialised */
+	    }
 
 	    vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
 	    es->format_rect.bottom = es->format_rect.top + max(1, vlc) * es->line_height;



More information about the wine-patches mailing list