From 64611054293d06a8b5ccdc41580ed3d3a805577e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 23 May 2012 19:39:47 +0200 Subject: [PATCH] main: Don't overrun the file that's read --- demos/gtk-demo/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index ce362a288b..95e841e615 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -655,7 +655,7 @@ load_file (const gchar *filename) start = end; - while (*p != '\n') p++; + while (*p && *p != '\n') p++; state++; }