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
1 changed files with 2 additions and 2 deletions

View File

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