VirtualBox

Changeset 96162 in vbox


Ignore:
Timestamp:
Aug 12, 2022 11:28:29 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/nocrt: Skip leading whitespace in the strtoxx and atoi functions. bugref:10261

Location:
trunk/src/VBox/Runtime/common/string
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/atoi.cpp

    r96059 r96162  
    4141#if INT_MAX == INT32_MAX
    4242    int32_t iValue = 0;
    43     int rc = RTStrToInt32Ex(psz, NULL, 10, &iValue);
     43    int rc = RTStrToInt32Ex(RTStrStripL(psz), NULL, 10, &iValue);
    4444#else
    4545# error "Unsupported integer size"
  • trunk/src/VBox/Runtime/common/string/nocrt-strtod.cpp

    r96159 r96162  
    4141{
    4242    double rd = 0.0;
    43     int rc = RTStrToDoubleEx(psz, ppszNext, 0, &rd);
     43    int rc = RTStrToDoubleEx(RTStrStripL(psz), ppszNext, 0, &rd);
    4444    if (rc != VINF_SUCCESS)
    4545        errno = RTErrConvertToErrno(rc);
  • trunk/src/VBox/Runtime/common/string/nocrt-strtol.cpp

    r96059 r96162  
    4242#if LONG_BIT == 64
    4343    int64_t iValue = 0;
    44     int rc = RTStrToInt64Ex(psz, ppszNext, (unsigned)iBase, &iValue);
     44    int rc = RTStrToInt64Ex(RTStrStripL(psz), ppszNext, (unsigned)iBase, &iValue);
    4545#elif LONG_BIT == 32
    4646    int32_t iValue = 0;
    47     int rc = RTStrToInt32Ex(psz, ppszNext, (unsigned)iBase, &iValue);
     47    int rc = RTStrToInt32Ex(RTStrStripL(psz), ppszNext, (unsigned)iBase, &iValue);
    4848#else
    4949# error "Unsupported LONG_BIT value"
  • trunk/src/VBox/Runtime/common/string/nocrt-strtoll.cpp

    r96059 r96162  
    4242#if LLONG_BIT == 64
    4343    int64_t iValue = 0;
    44     int rc = RTStrToInt64Ex(psz, ppszNext, (unsigned)iBase, &iValue);
     44    int rc = RTStrToInt64Ex(RTStrStripL(psz), ppszNext, (unsigned)iBase, &iValue);
    4545#else
    4646# error "Unsupported LLONG_BIT value"
  • trunk/src/VBox/Runtime/common/string/nocrt-strtoul.cpp

    r96059 r96162  
    4343#if LONG_BIT == 64
    4444    uint64_t uValue = 0;
    45     int rc = RTStrToUInt64Ex(psz, ppszNext, (unsigned)iBase, &uValue);
     45    int rc = RTStrToUInt64Ex(RTStrStripL(psz), ppszNext, (unsigned)iBase, &uValue);
    4646#elif LONG_BIT == 32
    4747    uint32_t uValue = 0;
    48     int rc = RTStrToUInt32Ex(psz, ppszNext, (unsigned)iBase, &uValue);
     48    int rc = RTStrToUInt32Ex(RTStrStripL(psz), ppszNext, (unsigned)iBase, &uValue);
    4949#else
    5050# error "Unsupported LONG_BIT value"
  • trunk/src/VBox/Runtime/common/string/nocrt-strtoull.cpp

    r96059 r96162  
    4343#if LLONG_BIT == 64
    4444    uint64_t uValue = 0;
    45     int rc = RTStrToUInt64Ex(psz, ppszNext, (unsigned)iBase, &uValue);
     45    int rc = RTStrToUInt64Ex(RTStrStripL(psz), ppszNext, (unsigned)iBase, &uValue);
    4646#else
    4747# error "Unsupported LLONG_BIT value"
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette