]> Pileus Git - ~andy/gtk/commitdiff
main: Don't overrun the file that's read
authorBenjamin Otte <otte@redhat.com>
Wed, 23 May 2012 17:39:47 +0000 (19:39 +0200)
committerCosimo Cecchi <cosimoc@gnome.org>
Wed, 30 May 2012 17:17:23 +0000 (13:17 -0400)
demos/gtk-demo/main.c

index ce362a288b6f089ac5e06dc2f982bb213e2e3d31..95e841e615cd9364fde6241e81f518785fb80f69 100644 (file)
@@ -655,7 +655,7 @@ load_file (const gchar *filename)
 
               start = end;
 
-              while (*p != '\n') p++;
+              while (*p && *p != '\n') p++;
 
               state++;
             }