Skip to content

Commit

Permalink
Cast to int before comparing with EOF (#745).
Browse files Browse the repository at this point in the history
  • Loading branch information
ashinn committed Dec 11, 2022
1 parent da53f46 commit e93b719
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e93b719

Please sign in to comment.