libc/string: Simplify strcmp - scc - simple c99 compiler
(HTM) git clone git://git.simple-cc.org/scc
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
(DIR) README
(DIR) LICENSE
---
(DIR) commit d55ef47946e20f9acb7601cb3c05247056c802e4
(DIR) parent 3f16edee3f63d37bcd7f41aec82daec377faf09f
(HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 11:41:53 +0100
libc/string: Simplify strcmp
Diffstat:
M src/libc/string/strcmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/src/libc/string/strcmp.c b/src/libc/string/strcmp.c
@@ -5,7 +5,7 @@
int
strcmp(const char *s1, const char *s2)
{
- while (*s1 && *s2 && *s1 == *s2)
+ while (*s1 && *s1 == *s2)
++s1, ++s2;
return *(unsigned char *) s1 - *(unsigned char *) s2;
}