VirtualBox

Changeset 103252 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 7, 2024 2:40:12 PM (10 months ago)
Author:
vboxsync
Message:

IPRT/string: Added RTStrCopy2() as a convenient function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/RTStrCopy.cpp

    r98103 r103252  
    4545
    4646
    47 RTDECL(int) RTStrCopy(char *pszDst, size_t cbDst, const char *pszSrc)
     47DECLINLINE(int) rtStrCopy(char *pszDst, size_t cbDst, const char *pszSrc)
    4848{
    4949    size_t cchSrc = strlen(pszSrc);
     
    6161    return VERR_BUFFER_OVERFLOW;
    6262}
     63
     64RTDECL(int) RTStrCopy(char *pszDst, size_t cbDst, const char *pszSrc)
     65{
     66    return rtStrCopy(pszDst, cbDst, pszSrc);
     67}
    6368RT_EXPORT_SYMBOL(RTStrCopy);
    6469
     70RTDECL(char *) RTStrCopy2(char *pszDst, size_t cbDst, const char *pszSrc)
     71{
     72    return RT_SUCCESS(rtStrCopy(pszDst, cbDst, pszSrc)) ? pszDst : NULL;
     73}
     74RT_EXPORT_SYMBOL(RTStrCopy2);
     75
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