From f91c757a54bdfb3d0ee43e5352973b9f940f0a71 Mon Sep 17 00:00:00 2001 From: solar Date: Mon, 19 Jul 2010 07:35:14 +0000 Subject: [PATCH] Type error resulting in improper handling of values > 127 and EOF. --- functions/stdio/fgetc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/stdio/fgetc.c b/functions/stdio/fgetc.c index 5837a74..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 -- 2.40.0