Author: jmorlan Date: Wed Mar 11 06:35:29 2009 New Revision: 39945
URL: http://svn.reactos.org/svn/reactos?rev=39945&view=rev Log: Fix bug where wcscspn could return non-zero value on an empty string.
Modified: trunk/reactos/lib/sdk/crt/wstring/wcscspn.c
Modified: trunk/reactos/lib/sdk/crt/wstring/wcscspn.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/wstring/wcscspn... ============================================================================== --- trunk/reactos/lib/sdk/crt/wstring/wcscspn.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/wstring/wcscspn.c [iso-8859-1] Wed Mar 11 06:35:29 2009 @@ -18,7 +18,7 @@ wchar_t *s; wchar_t *t; s=(wchar_t *)str; - do { + while (*s) { t=(wchar_t *)reject; while (*t) { if (*t==*s) @@ -28,6 +28,6 @@ if (*t) break; s++; - } while (*s); + } return s-str; /* nr of wchars */ }