Changeset 102989 in vbox for trunk/include/iprt
- Timestamp:
- Jan 22, 2024 5:12:25 PM (15 months ago)
- svn:sync-xref-src-repo-rev:
- 161221
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/string.h
r101366 r102989 244 244 #else /* !RT_OS_LINUX && !__KERNEL__ */ 245 245 # define RT_BCOPY_UNFORTIFIED(a_pDst, a_pSrc, a_cbToCopy) memcpy((a_pDst), (a_pSrc), (a_cbToCopy)) 246 #endif /* !RT_OS_LINUX && !__KERNEL__ */ 247 248 /** @def RT_STRSCPY 249 * Copy string and NULL-terminate output buffer. 250 * 251 * This macro should mostly be used in Linux kernel code. This is 252 * the replacement for deprecated strlcpy. It was deprecated since 3.16.60 253 * when strscpy was introduced as an alternative. Finally, strlcpy was 254 * completely removed from kernel code in 6.8.0. 255 * 256 * @param a_pDst Pointer to the destination string buffer. 257 * @param a_pSrc Pointer to the source NULL-terminated string buffer. 258 * @param a_cbToCopy Size of destination buffer.. 259 */ 260 #if defined(RT_OS_LINUX) && defined(__KERNEL__) 261 # if (RTLNX_VER_MIN(3,16,60)) 262 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbToCopy) strscpy((a_pDst), (a_pSrc), (a_cbToCopy)) 263 # else /* < 3.16.60 */ 264 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbToCopy) strlcpy((a_pDst), (a_pSrc), (a_cbToCopy)) 265 # endif 266 #else /* !RT_OS_LINUX && !__KERNEL__ */ 267 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbToCopy) strscpy((a_pDst), (a_pSrc), (a_cbToCopy)) 246 268 #endif /* !RT_OS_LINUX && !__KERNEL__ */ 247 269
Note:
See TracChangeset
for help on using the changeset viewer.