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

Functions

EXPORT errno_t wcsnset_s (wchar_t *restrict dest, rsize_t dmax, wchar_t value, rsize_t n)
 Sets maximal n wide characters of dest to a wide character value, but not the final NULL character. More...
 

Function Documentation

◆ wcsnset_s()

EXPORT errno_t wcsnset_s ( wchar_t *restrict  dest,
rsize_t  dmax,
wchar_t  value,
rsize_t  n 
)

Sets maximal n wide characters of dest to a wide character value, but not the final NULL character.

With SAFECLIB_STR_NULL_SLACK defined all elements following the terminating null character (if any) written in the array of dmax wide characters pointed to by dest are nulled.

Remarks
EXTENSION TO
  • ISO/IEC TR 24731, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
  • Implemented in the Windows secure API as _wcsnset_s()
Parameters
[out]destwide string that will be set.
[in]dmaxrestricted maximum length of dest
[in]valuewide character value to write
[in]nnumber of wide characters to be written
Return values
EOKwhen successful
ESNULLPwhen dest is NULL pointer
ESZEROLwhen dmax = 0
ESLEMAXwhen dmax > RSIZE_MAX_WSTR or value > max wchar_t
ESNOSPCwhen n > dmax
See also
wcsset_s(), wmemset_s(), strzero_s(), strnset_s(), strispassword_s()