VirtualBox

Changeset 100040 in vbox


Ignore:
Timestamp:
Jun 1, 2023 6:23:30 PM (18 months ago)
Author:
vboxsync
Message:

Runtime/RTFdt: Add methods to add stringlist properties, bugref:10401 [build fix]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/fdt.cpp

    r100037 r100040  
    16111611    uint32_t cbStrings = 0;
    16121612    for (uint32_t i = 0; i < cStrings; i++)
    1613         cbStrings += strlen(va_arg(vaCopy, const char *)) + 1; /* Include terminator. */
     1613        cbStrings += (uint32_t)strlen(va_arg(vaCopy, const char *)) + 1; /* Include terminator. */
    16141614
    16151615    uint32_t cbProp = RT_ALIGN_32(cbStrings + 3 * sizeof(uint32_t), sizeof(uint32_t)); /* Account for property token and the property data. */
     
    16261626    char *pb = (char *)pu32;
    16271627    for (uint32_t i = 0; i < cStrings; i++)
    1628         pb = stpcpy(pb, va_arg(va, const char *)) + 1;
     1628    {
     1629        const char *psz = va_arg(va, const char *);
     1630        /* MSVC doesn't know about stpcpy(), so we have to query the string length again... */
     1631        uint32_t cbStr = (uint32_t)strlen(psz);
     1632        strcpy(pb, psz);
     1633        pb += cbStr + 1;
     1634    }
    16291635
    16301636    pThis->cbStruct += cbProp;
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