[gtk+/wip/css] main: Don't overrun the file that's read



commit 521bbdad51a8116ea27ddf876138a6ba447d440a
Author: Benjamin Otte <otte redhat com>
Date:   Wed May 23 19:39:47 2012 +0200

    main: Don't overrun the file that's read

 demos/gtk-demo/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index df2a6c6..16d30cf 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -649,7 +649,7 @@ load_file (const gchar *filename)
 
               start = end;
 
-              while (*p != '\n') p++;
+              while (*p && *p != '\n') p++;
 
               state++;
             }



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