VirtualBox

Changeset 19928 in vbox for trunk


Ignore:
Timestamp:
May 22, 2009 11:47:35 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
47630
Message:

IPRT: More RTPathAppend docs updates.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/path.h

    r19927 r19928  
    349349 * concatenating the two partial paths.
    350350 *
    351  * @returns IPRT status code.
    352  * @retval  VERR_PATH
     351 * @retval  VINF_SUCCESS on success.
     352 * @retval  VERR_BUFFER_OVERFLOW if the result is too big to fit within
     353 *          cbPathDst bytes. No changes has been made.
     354 * @retval  VERR_INVALID_PARAMETER if the string pointed to by pszPath is longer
     355 *          than cbPathDst-1 bytes (failed to find terminator). Asserted.
    353356 *
    354357 * @param   pszPath         The path to append pszAppend to. This serves as both
    355358 *                          input and output. This can be empty, in which case
    356359 *                          pszAppend is just copied over.
    357  * @param   cchPathDst      The size of the buffer pszPath points to. This
    358  *                          should NOT be strlen(pszPath).
     360 * @param   cbPathDst       The size of the buffer pszPath points to, terminator
     361 *                          included. This should NOT be strlen(pszPath).
    359362 * @param   pszAppend       The partial path to append to pszPath. This can be
    360363 *                          NULL, in which case nothing is done.
     
    371374 *          sizeof(szBuf), "bar") will result in "C:bar".
    372375 */
    373 RTDECL(int) RTPathAppend(char *pszPath, size_t cchPathDst, const char *pszAppend);
     376RTDECL(int) RTPathAppend(char *pszPath, size_t cbPathDst, const char *pszAppend);
    374377
    375378
  • trunk/src/VBox/Runtime/r3/path.cpp

    r19926 r19928  
    729729
    730730
    731 RTDECL(int) RTPathAppend(char *pszPath, size_t cchPath, const char *pszAppend)
    732 {
    733     char *pszPathEnd = (char *)memchr(pszPath, '\0', cchPath);
     731RTDECL(int) RTPathAppend(char *pszPath, size_t cbPathDst, const char *pszAppend)
     732{
     733    char *pszPathEnd = (char *)memchr(pszPath, '\0', cbPathDst);
    734734    AssertReturn(pszPathEnd, VERR_INVALID_PARAMETER);
    735735
     
    744744    if (pszPathEnd == pszPath)
    745745    {
    746         if (cchAppend >= cchPath)
     746        if (cchAppend >= cbPathDst)
    747747            return VERR_BUFFER_OVERFLOW;
    748748        memcpy(pszPath, pszAppend, cchAppend + 1);
     
    762762                &&  RT_C_IS_ALPHA(pszPath[0]))
    763763            {
    764                 if ((size_t)(pszPathEnd - pszPath) + cchAppend >= cchPath)
     764                if ((size_t)(pszPathEnd - pszPath) + cchAppend >= cbPathDst)
    765765                    return VERR_BUFFER_OVERFLOW;
    766766            }
     
    768768#endif
    769769            {
    770                 if ((size_t)(pszPathEnd - pszPath) + 1 + cchAppend >= cchPath)
     770                if ((size_t)(pszPathEnd - pszPath) + 1 + cchAppend >= cbPathDst)
    771771                    return VERR_BUFFER_OVERFLOW;
    772772                *pszPathEnd++ = '/';
     
    779779                pszAppend++, cchAppend--;
    780780
    781             if ((size_t)(pszPathEnd - pszPath) + cchAppend >= cchPath)
     781            if ((size_t)(pszPathEnd - pszPath) + cchAppend >= cbPathDst)
    782782                return VERR_BUFFER_OVERFLOW;
    783783        }
     
    796796            pszPathEnd--;
    797797
    798         if ((size_t)(pszPathEnd - pszPath) + cchAppend >= cchPath)
     798        if ((size_t)(pszPathEnd - pszPath) + cchAppend >= cbPathDst)
    799799            return VERR_BUFFER_OVERFLOW;
    800800    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette