diff options
author | Felix Geyer <debfx-pkg@fobos.de> | 2010-05-19 18:16:21 +0200 |
---|---|---|
committer | Felix Geyer <debfx-pkg@fobos.de> | 2010-05-19 18:16:21 +0200 |
commit | 1ea6626f22e9895b90f8795f794aa229a233a545 (patch) | |
tree | 603ba0666d90c1e6a153fbbf44a8f6214aef65b7 /src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp | |
parent | 4f10dc4e82c2a0625f613db6c47113c8831d9214 (diff) | |
parent | 0c7f2a3d122182fe8890ea1f8178d1955c5a04dc (diff) | |
download | virtualbox-1ea6626f22e9895b90f8795f794aa229a233a545.tar.gz |
Merge branch 'experimental-upstream' into upstream
Conflicts:
src/VBox/Additions/linux/sharedfolders/files_vboxsf
Diffstat (limited to 'src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp')
-rw-r--r-- | src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp b/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp index 32332b190..a991619e7 100644 --- a/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp +++ b/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp @@ -1,10 +1,10 @@ -/* $Id: rtProcInitExePath-os2.cpp $ */ +/* $Id: rtProcInitExePath-os2.cpp 28929 2010-04-30 11:26:46Z vboxsync $ */ /** @file * IPRT - rtProcInitName, OS/2. */ /* - * Copyright (C) 2006-2008 Sun Microsystems, Inc. + * Copyright (C) 2006-2008 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -22,10 +22,6 @@ * * You may elect to license modified versions of this file under the * terms and conditions of either the GPL or the CDDL or both. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa - * Clara, CA 95054 USA or visit http://www.sun.com if you need - * additional information or have any questions. */ /******************************************************************************* @@ -51,16 +47,14 @@ DECLHIDDEN(int) rtProcInitExePath(char *pszPath, size_t cchPath) */ _execname(pszPath, cchPath); - char *pszTmp; - int rc = rtPathFromNative(&pszTmp, pszPath); - AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhsx\n", rc, pszPath, cchPath, pszPath), rc); - - size_t cch = strlen(pszTmp); - AssertReturn(cch <= cchPath, VERR_BUFFER_OVERFLOW); - - memcpy(pszPath, pszTmp, cch + 1); - RTStrFree(pszTmp); - - return VINF_SUCCESS; + char const *pszTmp; + int rc = rtPathFromNative(&pszTmp, pszPath, NULL); + AssertMsgRCReturn(rc, ("rc=%Rrc pszLink=\"%s\"\nhex: %.*Rhxs\n", rc, pszPath, cchPath, pszPath), rc); + if (pszTmp != pszPath) + { + rc = RTStrCopy(pszPath, cchPath, pszTmp); + rtPathFreeIprt(pszTmp, pszPath); + } + return rc; } |