Commit 2b0d9b56 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

midimap: Avoid using isdigit() for WCHARs.

Found with Coccinelle. Signed-off-by: 's avatarAkihiro Sagawa <sagawa.aki@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 71e61520
......@@ -116,14 +116,15 @@ static BOOL MIDIMAP_FindPort(const WCHAR* name, unsigned* dev)
return TRUE;
}
/* try the form #nnn */
if (*name == '#' && isdigit(name[1]))
if (*name == '#' && name[1] >= '0' && name[1] <= '9')
{
const WCHAR* ptr = name + 1;
*dev = 0;
do
{
*dev = *dev * 10 + *ptr - '0';
} while (isdigit(*++ptr));
ptr++;
} while (*ptr >= '0' && *ptr <= '9');
if (*dev < numMidiOutPorts)
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment