From 9579dfae25ea43f12a741f997d9942826aa3ade3 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. git-svn-id: https://srv7.svn-repos.de/dev34/pdclib/trunk@444 546481bc-9713-0410-bf18-d3337bbf4a3e --- 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.47.2