safec  3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
wcsnlen_s.c File Reference
#include "safe_str_lib.h"
+ Include dependency graph for wcsnlen_s.c:

Functions

EXPORT rsize_t wcsnlen_s (const wchar_t *dest, rsize_t dmax)
 The wcsnlen_s function computes the length of the wide string pointed to by dest. More...
 

Function Documentation

◆ wcsnlen_s()

EXPORT rsize_t wcsnlen_s ( const wchar_t *  dest,
rsize_t  dmax 
)

The wcsnlen_s function computes the length of the wide string pointed to by dest.

Remarks
SPECIFIED IN ISO/IEC TR 24731-1, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
Parameters
destpointer to wide string
dmaxmaximum length of wide string
Precondition
dest shall not be a null pointer.
dmax shall not equal zero.
dmax shall not be greater than RSIZE_MAX_WSTR.
Returns
The function returns the wide string length, excluding the terminating null character. If dest is NULL, then wcsnlen_s returns 0. Otherwise, the wcsnlen_s function returns the number of wide characters that precede the terminating null character. If there is no null character in the first dmax characters of dest then wcsnlen_s returns dmax. At most the first dmax characters of dest are accessed by wcsnlen_s.
See also
strnlen_s(), strnterminate_s()