diff options
author | Vinson Lee <[email protected]> | 2009-11-20 11:34:21 -0800 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2009-11-20 11:34:21 -0800 |
commit | c88b18a4df753205321ce1f7ddcd99244b670a1e (patch) | |
tree | c2c848f4e5ea3fc3302710eb350cf973b68fe8e7 /progs/slang | |
parent | d36cb2396c942f05ba56c5b899792a507bb0f0fd (diff) |
progs/slang: Check for ftell failure in vstest.c.
Diffstat (limited to 'progs/slang')
-rw-r--r-- | 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 472ea9b62e2..33c6f09dc55 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)); |