[DISKPART] Improve the conversion of numeric command parameters

This commit is contained in:
Eric Kohl 2022-03-28 00:04:24 +02:00
parent 72087c1e3a
commit 8476ae6ed5
4 changed files with 64 additions and 29 deletions

View file

@ -10,6 +10,28 @@
/* FUNCTIONS ******************************************************************/
BOOL
IsDecString(
_In_ PWSTR pszDecString)
{
PWSTR ptr;
if ((pszDecString == NULL) || (*pszDecString == UNICODE_NULL))
return FALSE;
ptr = pszDecString;
while (*ptr != UNICODE_NULL)
{
if (!iswdigit(*ptr))
return FALSE;
ptr++;
}
return TRUE;
}
BOOL
IsHexString(
_In_ PWSTR pszHexString)