mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[EVENTCREATE]: Use wcstoul() to retrieve and check for valid numerical values.
svn path=/trunk/; revision=75733
This commit is contained in:
parent
4e1f270f19
commit
5e78e7c3c1
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue