소스 검색

fix in flushbuf: make sure it does not return EOF when it actually succeeds

ceriel 28 년 전
부모
커밋
f2d5520159
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      lang/cem/libcc.ansi/stdio/flushbuf.c

+ 2 - 2
lang/cem/libcc.ansi/stdio/flushbuf.c

@@ -80,7 +80,7 @@ __flushbuf(int c, FILE * stream)
 			stream->_flags |= _IOERR;
 			return EOF;
 		}
-		return c;
+		return (unsigned char) c;
 	} else if (io_testflag(stream, _IOLBF)) {
 		*stream->_ptr++ = c;
 		/* stream->_count has been updated in putc macro. */
@@ -123,5 +123,5 @@ __flushbuf(int c, FILE * stream)
 		}
 		*(stream->_buf) = c;
 	}
-	return c;
+	return (unsigned char) c;
 }