]> git.saurik.com Git - apple/xnu.git/blobdiff - libsyscall/wrappers/string/strcmp.c
xnu-4903.270.47.tar.gz
[apple/xnu.git] / libsyscall / wrappers / string / strcmp.c
index cfe403516e85655a54737c6bd0358d99f10b49f9..d28024703ca4eaa31ab663770404aeaed5f8444d 100644 (file)
@@ -39,8 +39,10 @@ __attribute__((visibility("hidden")))
 int
 _libkernel_strcmp(const char *s1, const char *s2)
 {
-       while (*s1 == *s2++)
-               if (*s1++ == '\0')
-                       return (0);
-       return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
+       while (*s1 == *s2++) {
+               if (*s1++ == '\0') {
+                       return 0;
+               }
+       }
+       return *(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1);
 }