msstyles: Avoid using isspace() for WCHARs.

Found with Coccinelle.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2017-05-17 21:35:46 +09:00 committed by Alexandre Julliard
parent 98d0fa99da
commit 9abd3b9622
1 changed files with 7 additions and 2 deletions

View File

@ -1175,19 +1175,24 @@ static BOOL MSSTYLES_GetNextInteger(LPCWSTR lpStringStart, LPCWSTR lpStringEnd,
return TRUE;
}
static inline BOOL isSpace(WCHAR c)
{
return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
}
static BOOL MSSTYLES_GetNextToken(LPCWSTR lpStringStart, LPCWSTR lpStringEnd, LPCWSTR *lpValEnd, LPWSTR lpBuff, DWORD buffSize) {
LPCWSTR cur = lpStringStart;
LPCWSTR start;
LPCWSTR end;
while(cur < lpStringEnd && (isspace(*cur) || *cur == ',')) cur++;
while(cur < lpStringEnd && (isSpace(*cur) || *cur == ',')) cur++;
if(cur >= lpStringEnd) {
return FALSE;
}
start = cur;
while(cur < lpStringEnd && *cur != ',') cur++;
end = cur;
while(isspace(*end)) end--;
while(isSpace(*end)) end--;
lstrcpynW(lpBuff, start, min(buffSize, end-start+1));