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://git.gag.com/?a=commitdiff_plain;h=9579dfae25ea43f12a741f997d9942826aa3ade3;p=fw%2Fpdclib Type error resulting in improper handling of values > 127 and EOF. git-svn-id: https://srv7.svn-repos.de/dev34/pdclib/trunk@444 546481bc-9713-0410-bf18-d3337bbf4a3e --- 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