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-Url: https://pd.if.org/git/?p=pdclib.old;a=commitdiff_plain;h=31a65ba85aad0203b017b57fed050947ee2d9bd7 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