Changeset 78732 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- May 24, 2019 3:28:44 PM (6 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/RTUtf16CopyEx.cpp
r78704 r78732 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - RTUtf16Copy .3 * IPRT - RTUtf16CopyEx. 4 4 */ 5 5 … … 35 35 36 36 37 RTDECL(int) RTUtf16Copy (PRTUTF16 pwszDst, size_t cwcDst, PCRTUTF16 pwszSrc)37 RTDECL(int) RTUtf16CopyEx(PRTUTF16 pwszDst, size_t cwcDst, PCRTUTF16 pwszSrc, size_t cwcSrcMax) 38 38 { 39 size_t wcwSrc = RTUtf16Len(pwszSrc);40 if (RT_LIKELY( wcwSrc < cwcDst))39 size_t cwcSrc = RTUtf16NLen(pwszSrc, cwcSrcMax); 40 if (RT_LIKELY(cwcSrc < cwcDst)) 41 41 { 42 memcpy(pwszDst, pwszSrc, (wcwSrc + 1) * sizeof(RTUTF16)); 42 memcpy(pwszDst, pwszSrc, cwcSrc * sizeof(RTUTF16)); 43 pwszDst[cwcSrc] = '\0'; 43 44 return VINF_SUCCESS; 44 45 } … … 51 52 return VERR_BUFFER_OVERFLOW; 52 53 } 53 RT_EXPORT_SYMBOL(RTUtf16Copy );54 RT_EXPORT_SYMBOL(RTUtf16CopyEx); 54 55
Note:
See TracChangeset
for help on using the changeset viewer.