X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffgetc.c;h=b5a32572158fd89dc2875d65dfca75407073d231;hb=1eca3189422aef89f2f4706a1eb43d045b1985bc;hp=1a90eb95dadea9780b28a024c6fb94c9bad99570;hpb=35b4776e2f52f97caade5da75eb26cb24fb01c8b;p=pdclib.old diff --git a/functions/stdio/fgetc.c b/functions/stdio/fgetc.c index 1a90eb9..b5a3257 100644 --- a/functions/stdio/fgetc.c +++ b/functions/stdio/fgetc.c @@ -20,9 +20,9 @@ int fgetc( struct _PDCLIB_file_t * stream ) } if ( stream->ungetidx > 0 ) { - return stream->ungetbuf[ stream->ungetidx-- ]; + return (unsigned char)stream->ungetbuf[ --(stream->ungetidx) ]; } - return stream->buffer[stream->bufidx++]; + return (unsigned char)stream->buffer[stream->bufidx++]; } #endif