chiark / gitweb /
[PATCH] sync klibc with release 0.95
[elogind.git] / klibc / klibc / strncmp.c
index 98a41c37730f8c06efd806e416734759f975abe8..4dbde1389f77cce75743192b751e9fecc24f1ba0 100644 (file)
@@ -11,7 +11,7 @@ int strncmp(const char *s1, const char *s2, size_t n)
   int d = 0;
 
   while ( n-- ) {
-    d = (int)*c2++ - (int)(ch = *c1++);
+    d = (int)(ch = *c1++) - (int)*c2++;
     if ( d || !ch )
       break;
   }