forked from PoliEcho-holding-org/kern
Fixed errors
This commit is contained in:
+3
-3
@@ -2,14 +2,14 @@
|
||||
#include <syscall.h>
|
||||
|
||||
int getchar(void) { return getc(stdin); }
|
||||
int putchar(int c) { return putc(stdout); }
|
||||
int putchar(int c) { return putc(c, stdout); }
|
||||
|
||||
int getc(FILE* stream) {
|
||||
if (!stream) { return EOF; }
|
||||
|
||||
unsigned char ch;
|
||||
ssize_t res = read(stream->_file, &ch, 1);
|
||||
if (res <= 0) { return EOF; }
|
||||
if (res <= 0) { return EOF; }
|
||||
|
||||
return (int)ch;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ int putc(int c, FILE* stream) {
|
||||
|
||||
unsigned char ch = (unsigned char)c;
|
||||
ssize_t res = write(stream->_file, &c, 1);
|
||||
if (res <= 0) { return EOF; }
|
||||
if (res <= 0) { return EOF; }
|
||||
|
||||
return (int)ch;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user