VirtualBox

Ignore:
Timestamp:
Dec 12, 2017 6:25:40 PM (7 years ago)
Author:
vboxsync
Message:

IPRT: Added RTStrNICmpAscii.

File:
1 copied

Legend:

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

    r70091 r70092  
    3636
    3737
    38 RTDECL(int) RTStrICmpAscii(const char *psz1, const char *psz2)
     38RTDECL(int) RTStrNICmpAscii(const char *psz1, const char *psz2, size_t cchMax)
    3939{
     40    if (cchMax == 0)
     41        return 0;
    4042    if (psz1 == psz2)
    4143        return 0;
     
    4850    {
    4951        RTUNICP uc1;
    50         int rc = RTStrGetCpEx(&psz1, &uc1);
     52        int rc = RTStrGetCpNEx(&psz1, &cchMax, &uc1);
    5153        if (RT_SUCCESS(rc))
    5254        {
     
    7274        /* Hit some bad encoding, continue in case sensitive mode. */
    7375        else
    74             return RTStrCmp(psz1 - 1, psz2);
     76            return RTStrNCmp(psz1 - 1, psz2, cchMax + 1);
    7577    }
    7678}
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