diff --git a/platform/platform_unix.c b/platform/platform_unix.c index 94b5bdb..5d4a9c4 100644 --- a/platform/platform_unix.c +++ b/platform/platform_unix.c @@ -107,7 +107,7 @@ char *PlatformReadFile(Picoc *pc, const char *FileName) fclose(InFile); if ((ReadText[0] == '#') && (ReadText[1] == '!')) { - for (p = ReadText; (*p != '\r') && (*p != '\n'); ++p) { + for (p = ReadText; (*p != '\0') && (*p != '\r') && (*p != '\n'); ++p) { *p = ' '; } } diff --git a/tests/Makefile b/tests/Makefile index 9f2e6e9..bf038aa 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -62,7 +62,7 @@ TESTS= 00_assignment.test \ 66_printf_undefined.test \ 67_macro_crash.test \ 68_return.test \ - + 69_shebang_script.test \ include csmith/Makefile include jpoirier/Makefile @@ -72,6 +72,9 @@ include jpoirier/Makefile @if [ "x`echo $* | grep args`" != "x" ]; \ then \ ../picoc $*.c - arg1 arg2 arg3 arg4 2>&1 >$*.output; \ + elif [ "x`echo $* | grep script`" != "x" ]; \ + then \ + ../picoc -s $*.c 2>&1 >$*.output; \ else \ ../picoc $*.c 2>&1 >$*.output; \ fi