VirtualBox

Changeset 71435 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Mar 21, 2018 2:30:29 PM (7 years ago)
Author:
vboxsync
Message:

IPRT/net: RTNetStrToIPv4AddrEx - return VWRN_TRAILING_SPACES and
VWRN_TRAILING_CHARS. Adapt callers. Add more test cases to make sure
trailers are handled as before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/net/netaddrstr2.cpp

    r69111 r71435  
    7272    if (ppszNext != NULL)
    7373        *ppszNext = pszNext;
    74     return VINF_SUCCESS;
     74    return rc;
    7575}
    7676
     
    9494    pcszAddr = RTStrStripL(pcszAddr);
    9595    rc = rtNetStrToIPv4AddrEx(pcszAddr, pAddr, &pszNext);
    96     if (rc != VINF_SUCCESS)
    97         return VERR_INVALID_PARAMETER;
    98 
    99     pszNext = RTStrStripL(pszNext);
    100     if (*pszNext != '\0')
     96    if (RT_FAILURE(rc) || rc == VWRN_TRAILING_CHARS)
    10197        return VERR_INVALID_PARAMETER;
    10298
     
    138134    pcszAddr = RTStrStripL(pcszAddr);
    139135    rc = rtNetStrToIPv4AddrEx(pcszAddr, &addrIPv4, &pszNext);
    140     if (rc != VINF_SUCCESS)
    141         return false;
    142 
    143     pszNext = RTStrStripL(pszNext);
    144     if (*pszNext != '\0')
     136    if (RT_FAILURE(rc) || rc == VWRN_TRAILING_CHARS)
    145137        return false;
    146138
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