Merge branch 'master' into ev

This commit is contained in:
Calvin Rose 2020-05-30 11:35:19 -05:00
commit 71d8e6b4cd
2 changed files with 5 additions and 2 deletions

View File

@ -279,7 +279,10 @@ static Janet cfun_io_fclose(int32_t argc, Janet *argv) {
return janet_wrap_integer(WEXITSTATUS(status));
#endif
} else {
if (fclose(iof->file)) janet_panic("could not close file");
if (fclose(iof->file)) {
iof->flags |= JANET_FILE_NOT_CLOSEABLE;
janet_panic("could not close file");
}
iof->flags |= JANET_FILE_CLOSED;
return janet_wrap_nil();
}

View File

@ -285,7 +285,7 @@ static Janet ta_view_next(void *p, Janet key) {
}
}
if (!janet_checksize(key)) janet_panic("expected size as key");
size_t index = janet_unwrap_number(key);
size_t index = (size_t) janet_unwrap_number(key);
index++;
if (index < view->size) {
return janet_wrap_number((double) index);