Finds the last 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] | dlen | 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.
-
dlen shall not be 0.
-
dlen 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 dlen = 0 |
ESLEMAX | when dlen > RSIZE_MAX_STR |
ESLEMAX | when ch > 255 |
ESNOTFND | when ch not found in dest |
- See also
- memrchr_s(), strchr_s(), memchr_s(), strspn_s(), strstr_s()