Cast to int before comparing with EOF (#745).

This commit is contained in:
Alex Shinn 2022-12-11 22:56:45 +09:00
parent da53f46c93
commit e93b71990c

6
vm.c
View file

@ -2088,7 +2088,7 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
else
#endif
i = sexp_write_char(ctx, sexp_unbox_character(_ARG1), _ARG2);
if (i == EOF) {
if ((int)i == EOF) {
if (!sexp_port_openp(_ARG2))
sexp_raise("write-char: port is closed", _ARG2);
else
@ -2167,7 +2167,7 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
errno = 0;
#endif
i = sexp_read_char(ctx, _ARG1);
if (i == EOF) {
if ((int)i == EOF) {
if (!sexp_port_openp(_ARG1)) {
sexp_raise("read-char: port is closed", _ARG1);
#if SEXP_USE_GREEN_THREADS
@ -2203,7 +2203,7 @@ sexp sexp_apply (sexp ctx, sexp proc, sexp args) {
errno = 0;
#endif
i = sexp_read_char(ctx, _ARG1);
if (i == EOF) {
if ((int)i == EOF) {
if (!sexp_port_openp(_ARG1))
sexp_raise("peek-char: port is closed", _ARG1);
else