VirtualBox

Changeset 102992 in vbox for trunk/include


Ignore:
Timestamp:
Jan 22, 2024 5:33:49 PM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161224
Message:

iprt: Add wrapper for strlcpy/strscpy functions, build fix, bugref:10584.

Ignore return code of strscpy() in RT_STRSCPY macro sinse we have no caller
who is using it. Also rename macro parameter, so it makes more sense.

File:
1 edited

Legend:

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

    r102989 r102992  
    256256 * @param   a_pDst          Pointer to the destination string buffer.
    257257 * @param   a_pSrc          Pointer to the source NULL-terminated string buffer.
    258  * @param   a_cbToCopy      Size of destination buffer..
     258 * @param   a_cbDst         Size of destination buffer.
    259259 */
    260260#if defined(RT_OS_LINUX) && defined(__KERNEL__)
    261261# if (RTLNX_VER_MIN(3,16,60))
    262 #  define RT_STRSCPY(a_pDst, a_pSrc, a_cbToCopy)    strscpy((a_pDst), (a_pSrc), (a_cbToCopy))
     262#  define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst)   (void)strscpy((a_pDst), (a_pSrc), (a_cbDst))
    263263# else /* < 3.16.60 */
    264 #  define RT_STRSCPY(a_pDst, a_pSrc, a_cbToCopy)    strlcpy((a_pDst), (a_pSrc), (a_cbToCopy))
     264#  define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst)   strlcpy((a_pDst), (a_pSrc), (a_cbDst))
    265265# endif
    266266#else  /* !RT_OS_LINUX && !__KERNEL__ */
    267 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbToCopy)    strscpy((a_pDst), (a_pSrc), (a_cbToCopy))
     267# define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst)    (void)strscpy((a_pDst), (a_pSrc), (a_cbDst))
    268268#endif /* !RT_OS_LINUX && !__KERNEL__ */
    269269
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