+wcsncmp()
authorshort <>
Sun, 3 Aug 2003 07:18:18 +0000 (07:18 +0000)
committershort <>
Sun, 3 Aug 2003 07:18:18 +0000 (07:18 +0000)
Fixed wcsncmp(,,n=0).

ntoskrnl/rtl/wstring.c

index ee647f5..7a7dd80 100644 (file)
@@ -216,10 +216,11 @@ wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t count)
   return dest;
 }
 
+#endif /* LIBCAPTIVE */
 
 int wcsncmp(const wchar_t *cs, const wchar_t *ct, size_t count)
 {
-  while (*cs != '\0' && *ct != '\0' && *cs == *ct && --count)
+  while (*cs != '\0' && *ct != '\0' && *cs == *ct && count-- > 0)
     {
       cs++;
       ct++;
@@ -227,6 +228,7 @@ int wcsncmp(const wchar_t *cs, const wchar_t *ct, size_t count)
   return *cs - *ct;
 }
 
+#ifndef LIBCAPTIVE
 
 wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t count)
 {