Finds the first occurrence of ch
(after conversion to unsigned char as if by (unsigned char)ch
) in the null-terminated buffer pointed to by dest
(each character interpreted as unsigned char
).
- Parameters
-
[in] | dest | pointer to buffer to compare against |
[in] | dlen | length of dest to search in |
[in] | ch | character to search for |
[out] | result | pointer to result in dest |
- Precondition
- Neither dest nor result shall be a null pointer.
-
dlen shall not be 0.
-
dlen shall not be greater than RSIZE_MAX_MEM.
-
ch shall not be greater than 255
- Return values
-
EOK | when successfully character found. |
ESNULLP | when dest/result is a NULL pointer |
ESZEROL | when dlen = 0 |
ESLEMAX | when dlen > RSIZE_MAX_STR |
ESLEMAX | when ch > 255 |
ESNOTFND | when ch not found in dest |
- See also
- strchr_s(), strspn_s(), strcspn_s(), strpbrk_s(), strstr_s()