scc

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

commit 0b353ff11d5bff34a621e2775fc146ccce335a26
parent 259a53eff5cb9fcc141fa5d8de89bbdca22808e1
Author: sin <sin@2f30.org>
Date:   Fri,  9 Nov 2018 13:25:18 +0000

[libc] Initialize ch in fgets()

Signed-off-by: sin <sin@2f30.org>

Diffstat:
Mlib/c/stdio/fgets.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/c/stdio/fgets.c b/lib/c/stdio/fgets.c @@ -4,7 +4,7 @@ char * fgets(char *s, int n, FILE *fp) { - int ch; + int ch = 0; char *t = s; while (--n > 0 && (ch = getc(fp)) != EOF) {