Sets the first n uint16_t values starting at dest to the specified value, but maximal dmax bytes.
- Parameters
-
[out] | dest | pointer to memory that will be set to the value |
[in] | dmax | maximum number of bytes to be written |
[in] | value | byte value to be written |
[in] | n | number of short (2-byte) words to be set |
- Precondition
- dest shall not be a null pointer.
-
dmax shall not be 0
-
dmax shall not be greater than RSIZE_MAX_MEM.
-
n shall not be greater than RSIZE_MAX_MEM16.
-
dmax*2 may not be smaller than n.
- Returns
- If there is a runtime-constraints violation, and if dest is not a null pointer, and if dmax is not larger than RSIZE_MAX_MEM, then, before reporting the runtime-constraints violation, memset16_s() copies dmax bytes to the destination.
- Return values
-
EOK | when operation is successful |
ESNULLP | when dest is NULL POINTER |
ESZEROL | Only before C11 when n = ZERO |
ESLEMAX | when dmax > RSIZE_MAX_MEM |
ESLEMAX | when n > RSIZE_MAX_MEM16 |
ESNOSPC | when dmax/2 < n |
- See also
- memset_s(), memset32_s()