From: solar Date: Mon, 19 Jul 2010 07:35:14 +0000 (+0000) Subject: Type error resulting in improper handling of values > 127 and EOF. X-Git-Tag: v0.5~57 X-Git-Url: https://pd.if.org/git/?p=pdclib;a=commitdiff_plain;h=f91c757a54bdfb3d0ee43e5352973b9f940f0a71 Type error resulting in improper handling of values > 127 and EOF. --- 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