mirror of
https://github.com/reactos/reactos.git
synced 2026-06-09 09:23:04 +08:00
[EVENTCREATE]: Use wcstoul() to retrieve and check for valid numerical values.
svn path=/trunk/; revision=75733
This commit is contained in:
@@ -914,7 +914,18 @@ DoParse(
|
||||
// case TYPE_U16:
|
||||
case TYPE_U32:
|
||||
{
|
||||
*(ULONG*)Options[Option].Value = (ULONG)_wtol(argv[i]);
|
||||
PWCHAR pszNext = NULL;
|
||||
|
||||
/* The number is specified in base 10 */
|
||||
// NOTE: We might use '0' so that the base is automatically determined.
|
||||
*(ULONG*)Options[Option].Value = wcstoul(argv[i], &pszNext, 10);
|
||||
if (*pszNext)
|
||||
{
|
||||
/* The value is not a valid numeric value and is not allowed */
|
||||
if (PrintErrorFunc)
|
||||
PrintErrorFunc(InvalidValue, argv[i], OptionStr);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user