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



commit 64611054293d06a8b5ccdc41580ed3d3a805577e
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 ce362a2..95e841e 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++;
             }



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