X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstdio%2Ffgetc.c;h=b5a32572158fd89dc2875d65dfca75407073d231;hb=f91c757a54bdfb3d0ee43e5352973b9f940f0a71;hp=1a90eb95dadea9780b28a024c6fb94c9bad99570;hpb=393020b6e48719d27699dea6b29e53025bbd5123;p=pdclib 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