Actually return from krk_runfile on read failure

This commit is contained in:
K Lange 2021-03-25 22:58:23 +09:00
parent 60f148c3e2
commit 8c63995342

View File

@ -2841,6 +2841,7 @@ KrkValue krk_runfile(const char * fileName, char * fromFile) {
char * buf = malloc(size+1);
if (fread(buf, 1, size, f) != size) {
fprintf(stderr, "%s: could not read file '%s': %s\n", "kuroko", fileName, strerror(errno));
return INTEGER_VAL(errno);
}
fclose(f);
buf[size] = '\0';