VirtualBox

Changeset 3160 in vbox


Ignore:
Timestamp:
Jun 19, 2007 5:26:15 PM (17 years ago)
Author:
vboxsync
Message:

rtUtf16RecodeAsUtf8 takes a cch excluding the terminator. removed dead code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/utf-16.cpp

    r3125 r3160  
    477477            if (cch <= cchResult)
    478478                return VERR_BUFFER_OVERFLOW;
    479             // cchResult = cch;
    480479            pszResult = *ppsz;
    481480        }
     
    484483            *ppsz = NULL;
    485484            fShouldFree = true;
    486             // cchResult = RT_MAX(cch, cchResult + 1);
    487485            cch = RT_MAX(cch, cchResult + 1);
    488486            pszResult = (char *)RTMemAlloc(cch);
     
    490488        if (pszResult)
    491489        {
    492             rc = rtUtf16RecodeAsUtf8(pwszString, cwcString, pszResult, cch, &cchResult);
     490            rc = rtUtf16RecodeAsUtf8(pwszString, cwcString, pszResult, cch - 1, &cch);
    493491            if (RT_SUCCESS(rc))
    494492            {
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