explicit initialization of result in s2d_strlen
This commit is contained in:
1 parent
e6e134fff6
commit
299b6bc1f5
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user