VirtualBox

Changeset 28915 in vbox for trunk/src/VBox/Runtime/r3/os2


Ignore:
Timestamp:
Apr 29, 2010 6:12:35 PM (15 years ago)
Author:
vboxsync
Message:

iprt: More path conversion avoidance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp

    r28800 r28915  
    4848    _execname(pszPath, cchPath);
    4949
    50     char *pszTmp;
    51     int rc = rtPathFromNative(&pszTmp, pszPath);
     50    char const *pszTmp;
     51    int rc = rtPathFromNative(&pszTmp, pszPath, NULL);
    5252    AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhsx\n", rc, pszPath, cchPath, pszPath), rc);
    53 
    54     size_t cch = strlen(pszTmp);
    55     AssertReturn(cch <= cchPath, VERR_BUFFER_OVERFLOW);
    56 
    57     memcpy(pszPath, pszTmp, cch + 1);
    58     RTStrFree(pszTmp);
    59 
    60     return VINF_SUCCESS;
     53    if (pszTmp != pszPath)
     54    {
     55        rc = RTStrCopy(pszPath, cchPath, pszTmp);
     56        rtPathFreeIprt(pszTmp, pszPath);
     57    }
     58    return rc;
    6159}
    6260
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