shithub: scc

Download patch

ref: 351881313c73f9276a102d1508ca59e3cc8ad7b1
parent: 57fd86ea77bab85e988d003883dc323e2190d6b7
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Oct 16 09:15:37 EDT 2018

[lib/c] Fix value returned in __getc() and __putc()

--- a/lib/c/__getc.c
+++ b/lib/c/__getc.c
@@ -25,7 +25,7 @@
 	if (fp->buf == NULL) {
 		if ((fp->buf = malloc(BUFSIZ)) == NULL) {
 			errno = ENOMEM;
-			return NULL;
+			return EOF;
 		}
 		fp->flags |= _IOALLOC;
 	}
--- a/lib/c/__putc.c
+++ b/lib/c/__putc.c
@@ -48,7 +48,7 @@
 	if (fp->buf == NULL) {
 		if ((fp->buf = malloc(BUFSIZ)) == NULL) {
 			errno = ENOMEM;
-			return NULL;
+			return EOF;
 		}
 		fp->flags |= _IOALLOC;
 	}