scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit c28baef4523a183c068671d539f93f8bec5ccf7b
parent 15a9dbb432b0baf575557c2bca9cb2ec2e5a3112
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 16 Oct 2018 13:15:37 +0100

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

Diffstat:
Mlib/c/__getc.c | 2+-
Mlib/c/__putc.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

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