]> pd.if.org Git - pdclib/commitdiff
Type error resulting in improper handling of values > 127 and EOF.
authorsolar <unknown>
Mon, 19 Jul 2010 07:35:14 +0000 (07:35 +0000)
committersolar <unknown>
Mon, 19 Jul 2010 07:35:14 +0000 (07:35 +0000)
functions/stdio/fgetc.c

index 5837a74178f596362053de7dfadff5e924baa960..b5a32572158fd89dc2875d65dfca75407073d231 100644 (file)
@@ -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