Fix bug where wcscspn could return non-zero value on an empty string.

svn path=/trunk/; revision=39945
This commit is contained in:
Jeffrey Morlan 2009-03-11 03:35:29 +00:00
parent db0b0ba158
commit acdae19a65

View file

@ -18,7 +18,7 @@ size_t wcscspn(const wchar_t *str,const wchar_t *reject)
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 @@ size_t wcscspn(const wchar_t *str,const wchar_t *reject)
if (*t)
break;
s++;
} while (*s);
}
return s-str; /* nr of wchars */
}