shithub: scc

Download patch

ref: af25b58d05b0700990057ce3f8c853bd43f2ece0
parent: 8eae1d47c3534a3ce3902a8895e80dbb4f90375a
author: sin <sin@2f30.org>
date: Fri Nov 9 08:25:18 EST 2018

[libc] Initialize ch in fgets()

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

--- 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) {