OpenBSD manual page server

Manual Page Search Parameters

WCSLEN(3) Library Functions Manual WCSLEN(3)

wcslen, wcsnlenfind length of a wide string

#include <wchar.h>

size_t
wcslen(const wchar_t *s);

size_t
wcsnlen(const wchar_t *s, size_t maxlen);

The () function computes the length of the wide string s. The () function computes the length of the wide string s, up to maxlen wide characters. The wcsnlen() function will never attempt to address more than maxlen wide characters, making it suitable for use with wide character arrays that are not guaranteed to be NUL-terminated.

The wcslen() function returns the number of wide characters that precede the terminating null wide character.

The wcsnlen() function returns the number of wide characters that precede the terminating null wide character or maxlen, whichever is smaller.

strlen(3), wcswidth(3)

The wcslen() function conforms to ISO/IEC 9899:1999 (“ISO C99”) and was first introduced in ISO/IEC 9899/AMD1:1995 (“ISO C90, Amendment 1”). The wcsnlen() function conforms to IEEE Std 1003.1-2008 (“POSIX.1”).

The wcslen() function was ported from NetBSD and first appeared in OpenBSD 3.8. The wcsnlen() function first appeared in OpenBSD 7.6.

July 14, 2024 OpenBSD-7.6