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

This commit is contained in:
Vinson Lee 2009-11-20 11:34:21 -08:00
parent d36cb2396c
commit c88b18a4df

View file

@ -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));