VirtualBox

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/solaris/rtProcInitExePath-solaris.cpp

    r28800 r28915  
    5252        pszPath[cchLink] = '\0';
    5353
    54         char *pszTmp = NULL;
    55         int rc = rtPathFromNative(&pszTmp, pszPath);
     54        char const *pszTmp;
     55        int rc = rtPathFromNative(&pszTmp, pszPath, NULL);
    5656        AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhsx\n", rc, pszPath, cchLink, pszPath), rc);
    57 
    58         size_t cch = strlen(pszTmp);
    59         AssertReturn(cch <= cchPath, VERR_BUFFER_OVERFLOW);
    60 
    61         memcpy(pszPath, pszTmp, cch + 1);
    62         RTStrFree(pszTmp);
    63 
    64         return VINF_SUCCESS;
     57        if (pszTmp != pszPath)
     58        {
     59            rc = RTStrCopy(pszPath, cchPath, pszTmp);
     60            rtPathFreeIprt(pszTmp, pszPath);
     61        }
     62        return rc;
    6563    }
    6664
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