summaryrefslogtreecommitdiff
path: root/progs/slang
diff options
context:
space:
mode:
Diffstat (limited to 'progs/slang')
-rw-r--r--progs/slang/cltest.c2
-rw-r--r--progs/slang/vstest.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/progs/slang/cltest.c b/progs/slang/cltest.c
index 2753f59f85..dfff6cb226 100644
--- a/progs/slang/cltest.c
+++ b/progs/slang/cltest.c
@@ -237,7 +237,7 @@ void RenderScene (void)
if (p != NULL)
p++;
}
- if (*p != '\0')
+ if (p && *p != '\0')
printf ("*** %s\n", "I/O error");
nextprogram = program->next;
diff --git a/progs/slang/vstest.c b/progs/slang/vstest.c
index 472ea9b62e..33c6f09dc5 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));