Module: Mesa
Branch: mesa_7_7_branch
Commit: c88b18a4df753205321ce1f7ddcd99244b670a1e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c88b18a4df753205321ce1f7ddcd99244b670a1e

Author: Vinson Lee <[email protected]>
Date:   Fri Nov 20 11:34:21 2009 -0800

progs/slang: Check for ftell failure in vstest.c.

---

 progs/slang/vstest.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/progs/slang/vstest.c b/progs/slang/vstest.c
index 472ea9b..33c6f09 100644
--- a/progs/slang/vstest.c
+++ b/progs/slang/vstest.c
@@ -220,6 +220,12 @@ static void load_test_file (const char *filename)
 
    fseek (f, 0, SEEK_END);
    size = ftell (f);
+
+   if (size == -1) {
+      fclose (f);
+      return;
+   }
+
    fseek (f, 0, SEEK_SET);
 
    code = (char *) (malloc (size));

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to