diff dwtest.c @ 893:39ab47d103c3

Fix for invalid data being passed to dw_color_foreground_set() on the first line of the file.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 17 Apr 2011 06:22:08 +0000
parents ca01c7d95b80
children 2b07bf8ed95b
line wrap: on
line diff
--- a/dwtest.c	Sun Apr 17 03:34:18 2011 +0000
+++ b/dwtest.c	Sun Apr 17 06:22:08 2011 +0000
@@ -283,7 +283,7 @@
          fileline = i + row - 1;
          y = i*font_height;
          dw_color_background_set( 1 + (fileline % 15) );
-         dw_color_foreground_set( fileline % 16 );
+         dw_color_foreground_set( fileline < 0 ? DW_CLR_WHITE : fileline % 16 );
          sprintf( buf, "%6.6d", i+row );
          dw_draw_text( 0, text1pm, 0, y, buf);
          pLine = lp[i+row];