WCSLEN(3)

NAME
wcslen, wcsnlen - find length of a wide string

SYNOPSIS
#include <wchar.h>
size_t
wcslen(const wchar_t *s);
size_t
wcsnlen(const wchar_t *s, size_t maxlen);

DESCRIPTION
The wcslen() function computes the length of the wide string s. The wcsnlen() 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.

RETURN VALUES
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.

SEE ALSO
strlen(3), wcswidth(3)

STANDARDS
The wcslen() function conforms to isoC-99 and was first introduced in isoC-amd1. The wcsnlen() function conforms to p1003.1-2008.

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