projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d36cb23
)
progs/slang: Check for ftell failure in vstest.c.
author
Vinson Lee
<vlee@vmware.com>
Fri, 20 Nov 2009 19:34:21 +0000
(11:34 -0800)
committer
Vinson Lee
<vlee@vmware.com>
Fri, 20 Nov 2009 19:34:21 +0000
(11:34 -0800)
progs/slang/vstest.c
patch
|
blob
|
history
diff --git
a/progs/slang/vstest.c
b/progs/slang/vstest.c
index 472ea9b62e2abecb5015122f0bc3f93c81a9b34c..33c6f09dc5521f3615e3b4f808189565b481bd54 100644
(file)
--- 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));