mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 07:28:19 +00:00
[USETUP] Some fixes/improvements suggested by Thomas (1/2).
- isspace('\0') returns FALSE anyways so no need to separately test for a NULL character; - The (str/wcs)toul function cannot return a NULL pointer from its second paramter; - VersionInfo32_FindChild(): the third argument is indeed a number of characters (not bytes), so rename the parameter to make this fact clear. The function is however correctly used within this module. svn path=/branches/setup_improvements/; revision=74629
This commit is contained in:
parent
5a6050902b
commit
3074ad7159
2 changed files with 4 additions and 5 deletions
|
@ -142,7 +142,7 @@ ArcGetNextTokenA(
|
||||||
KeyValue = strtoul(p, (PSTR*)&p, 10);
|
KeyValue = strtoul(p, (PSTR*)&p, 10);
|
||||||
|
|
||||||
/* Skip any trailing whitespace */
|
/* Skip any trailing whitespace */
|
||||||
while (*p && isspace(*p)) ++p;
|
while (isspace(*p)) ++p;
|
||||||
|
|
||||||
/* The token must terminate with ')' */
|
/* The token must terminate with ')' */
|
||||||
if (*p != ')')
|
if (*p != ')')
|
||||||
|
@ -202,10 +202,9 @@ ArcGetNextTokenU(
|
||||||
*/
|
*/
|
||||||
// KeyValue = _wtoi(p);
|
// KeyValue = _wtoi(p);
|
||||||
KeyValue = wcstoul(p, (PWSTR*)&p, 10);
|
KeyValue = wcstoul(p, (PWSTR*)&p, 10);
|
||||||
ASSERT(p);
|
|
||||||
|
|
||||||
/* Skip any trailing whitespace */
|
/* Skip any trailing whitespace */
|
||||||
while (*p && iswspace(*p)) ++p;
|
while (iswspace(*p)) ++p;
|
||||||
|
|
||||||
/* The token must terminate with ')' */
|
/* The token must terminate with ')' */
|
||||||
if (*p != L')')
|
if (*p != L')')
|
||||||
|
|
|
@ -104,13 +104,13 @@ static PCVS_VERSION_INFO_STRUCT32
|
||||||
VersionInfo32_FindChild(
|
VersionInfo32_FindChild(
|
||||||
IN PCVS_VERSION_INFO_STRUCT32 info,
|
IN PCVS_VERSION_INFO_STRUCT32 info,
|
||||||
IN PCWSTR szKey,
|
IN PCWSTR szKey,
|
||||||
IN UINT cbKey)
|
IN UINT cchKey)
|
||||||
{
|
{
|
||||||
PCVS_VERSION_INFO_STRUCT32 child = VersionInfo32_Children(info);
|
PCVS_VERSION_INFO_STRUCT32 child = VersionInfo32_Children(info);
|
||||||
|
|
||||||
while ((ULONG_PTR)child < (ULONG_PTR)info + info->wLength)
|
while ((ULONG_PTR)child < (ULONG_PTR)info + info->wLength)
|
||||||
{
|
{
|
||||||
if (!_wcsnicmp(child->szKey, szKey, cbKey) && !child->szKey[cbKey])
|
if (!_wcsnicmp(child->szKey, szKey, cchKey) && !child->szKey[cchKey])
|
||||||
return child;
|
return child;
|
||||||
|
|
||||||
if (child->wLength == 0) return NULL;
|
if (child->wLength == 0) return NULL;
|
||||||
|
|
Loading…
Reference in a new issue