Finds the first occurrence of ch (after conversion to char as if by (char)ch) in the null-terminated byte string pointed to by dest (each character interpreted as unsigned char).
The terminating null character is considered to be a part of the string and can be found when searching for '\0'.
- Parameters
-
[in] | dest | pointer to string to compare against |
[in] | dmax | restricted maximum length of dest |
[in] | ch | character to search for |
[out] | result | pointer to char* in dest |
- Precondition
- Neither dest nor result shall be a null pointer.
-
dmax shall not be 0.
-
dmax shall not be greater than RSIZE_MAX_STR.
-
ch shall not be greater than 255
- Return values
-
EOK | when successfully character found. |
ESNULLP | when dest/result is a NULL pointer |
ESZEROL | when dmax = 0 |
ESLEMAX | when dmax > RSIZE_MAX_STR |
ESLEMAX | when ch > 255 |
ESNOTFND | when ch not found in dest |
- See also
- memchr_s(), strspn_s(), strcspn_s(), strpbrk_s(), strstr_s()