]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/String/Comparison.c
Add Socket Libraries.
[mirror_edk2.git] / StdLib / LibC / String / Comparison.c
index e656fe73f5059c5404a3f60cef00f29f437d5e34..b4980c7c1e880273203c169f1f5fdc1ea54cc070 100644 (file)
@@ -109,10 +109,15 @@ strcasecmp(const char *s1, const char *s2)
 {\r
   const unsigned char *us1 = (const unsigned char *)s1,\r
   *us2 = (const unsigned char *)s2;\r
+  int Difference;\r
 \r
-  while (tolower(*us1) == tolower(*us2++))\r
-    if (*us1++ == '\0')\r
+  while ( 0 == ( Difference = tolower(*us1) - tolower(*us2))) {\r
+    if (*us1 == 0) {\r
     return (0);\r
-  return (tolower(*us1) - tolower(*--us2));\r
+    }\r
+    us1 += 1;\r
+    us2 += 1;\r
+  }\r
+  return Difference;\r
 }\r
 \r