]> pd.if.org Git - pdclib/blobdiff - functions/stdio/fgetc.c
Comment cleanups.
[pdclib] / functions / stdio / fgetc.c
index 5837a74178f596362053de7dfadff5e924baa960..5afa4222da6b79e39c02c972636674cdcdb39f4f 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* fgetc( FILE * )
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -8,10 +6,10 @@
 
 #include <stdio.h>
 
-#include <_PDCLIB_glue.h>
-
 #ifndef REGTEST
 
+#include <_PDCLIB_glue.h>
+
 int fgetc( struct _PDCLIB_file_t * stream )
 {
     if ( _PDCLIB_prepread( stream ) == EOF )
@@ -20,9 +18,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