Fixed strchrW and strrchrW for a null character (spotted by Aric

Stewart).
This commit is contained in:
Alexandre Julliard 2005-07-12 19:27:41 +00:00
parent 0791d06215
commit e40383699e

View file

@ -215,14 +215,14 @@ static inline WCHAR *strcatW( WCHAR *dst, const WCHAR *src )
static inline WCHAR *strchrW( const WCHAR *str, WCHAR ch )
{
for ( ; *str; str++) if (*str == ch) return (WCHAR *)str;
do { if (*str == ch) return (WCHAR *)str; } while (*str++);
return NULL;
}
static inline WCHAR *strrchrW( const WCHAR *str, WCHAR ch )
{
WCHAR *ret = NULL;
for ( ; *str; str++) if (*str == ch) ret = (WCHAR *)str;
do { if (*str == ch) ret = (WCHAR *)str; } while (*str++);
return ret;
}