1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

util/charset: Rename utf16_len() to utf16_null_terminated_len()

The new name indicates that — contrary to functions such as strnlen() —
the length may include the terminator.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-11-09 12:36:21 +13:00 committed by Andrew Bartlett
parent 542e5a3039
commit 16996d145b
2 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ size_t ucs2_align(const void *base_ptr, const void *p, int flags);
return the number of bytes occupied by a buffer in CH_UTF16 format
the result includes the null termination
**/
size_t utf16_len(const void *buf);
size_t utf16_null_terminated_len(const void *buf);
/**
return the number of bytes occupied by a buffer in CH_UTF16 format

View File

@ -195,7 +195,7 @@ size_t ucs2_align(const void *base_ptr, const void *p, int flags)
return the number of bytes occupied by a buffer in CH_UTF16 format
the result includes the null termination
**/
size_t utf16_len(const void *buf)
size_t utf16_null_terminated_len(const void *buf)
{
size_t len;
@ -501,7 +501,7 @@ static size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src
if (flags & STR_TERMINATE) {
if (src_len == (size_t)-1) {
src_len = utf16_len(src);
src_len = utf16_null_terminated_len(src);
} else {
src_len = utf16_null_terminated_len_n(src, src_len);
}