Changeset 103024 in vbox
- Timestamp:
- Jan 24, 2024 1:37:01 PM (13 months ago)
- svn:sync-xref-src-repo-rev:
- 161259
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/string.h
r102999 r103024 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_STRSCPY249 * Copy string and NULL-terminate output buffer.250 *251 * This macro should mostly be used in Linux kernel code. This is252 * the replacement for deprecated strlcpy. It was deprecated since 4.3.0253 * when strscpy was introduced as an alternative. Finally, strlcpy was254 * 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_cbDst Size of destination buffer.259 */260 #if defined(RT_OS_LINUX) && defined(__KERNEL__)261 # if (RTLNX_VER_MIN(4,3,0))262 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst) \263 { \264 ssize_t _ret; \265 _ret = strscpy((a_pDst), (a_pSrc), (a_cbDst)); \266 }267 # else /* < 4.3.0 */268 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst) strlcpy((a_pDst), (a_pSrc), (a_cbDst))269 # endif270 #else /* !RT_OS_LINUX && !__KERNEL__ */271 # define RT_STRSCPY(a_pDst, a_pSrc, a_cbDst) strlcpy((a_pDst), (a_pSrc), (a_cbDst))272 246 #endif /* !RT_OS_LINUX && !__KERNEL__ */ 273 247 -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
r102990 r103024 1411 1411 } 1412 1412 else if (pParam->name[0] != 'd') 1413 RT_STRSCPY(&g_szLogGrp[0], pszValue, sizeof(g_szLogGrp)); 1414 1413 RTStrCopy(&g_szLogGrp[0], sizeof(g_szLogGrp), pszValue); 1415 1414 return 0; 1416 1415 } … … 1437 1436 } 1438 1437 else if (pParam->name[0] != 'd') 1439 RT _STRSCPY(&g_szLogFlags[0], pszValue, sizeof(g_szLogFlags));1438 RTStrCopy(&g_szLogFlags[0], sizeof(g_szLogFlags), pszValue); 1440 1439 return 0; 1441 1440 } … … 1462 1461 } 1463 1462 else if (pParam->name[0] != 'd') 1464 RT _STRSCPY(&g_szLogDst[0], pszValue, sizeof(g_szLogDst));1463 RTStrCopy(&g_szLogDst[0], sizeof(g_szLogDst), pszValue); 1465 1464 return 0; 1466 1465 } -
trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c
r102990 r103024 1409 1409 case Opt_iocharset: 1410 1410 case Opt_nls: 1411 RT _STRSCPY(info->nls_name, param->string, sizeof(info->nls_name));1411 RTStrCopy(info->nls_name, sizeof(info->nls_name), param->string); 1412 1412 break; 1413 1413 case Opt_uid: … … 1470 1470 break; 1471 1471 case Opt_tag: 1472 RT _STRSCPY(info->szTag, param->string, sizeof(info->szTag));1472 RTStrCopy(info->szTag, sizeof(info->szTag), param->string); 1473 1473 break; 1474 1474 default: … … 1529 1529 1530 1530 /* fc->source (the shared folder name) is set after vbsf_init_fs_ctx() */ 1531 RT _STRSCPY(info->name, fc->source, sizeof(info->name));1531 RTStrCopy(info->name, sizeof(info->name), fc->source); 1532 1532 1533 1533 # if RTLNX_VER_MAX(5,3,0)
Note:
See TracChangeset
for help on using the changeset viewer.