From 299b6bc1f52509ee9fa2d3705f6ef48c4cff315f Mon Sep 17 00:00:00 2001 From: farisawan-2000 Date: Fri, 15 Jan 2021 17:26:07 -0500 Subject: [PATCH] explicit initialization of result in s2d_strlen --- s2d_ustdlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s2d_ustdlib.c b/s2d_ustdlib.c index 63406bde..8f4d24ff 100644 --- a/s2d_ustdlib.c +++ b/s2d_ustdlib.c @@ -48,7 +48,7 @@ int s2d_ilen(char *s) { } int s2d_strlen(char *s) { - int result; + int result = 0; char *p = s; do {result++;} while (*(++p) != '\0'); return result;