The strstr_s() function locates the first occurrence of the substring pointed to by src which would be located in the string pointed to by dest.
- Parameters
-
[in] | dest | pointer to string to be searched for the substring |
[in] | dmax | restricted maximum length of dest string |
[in] | src | pointer to the sub string |
[in] | slen | the maximum number of characters to use from src |
[out] | substring | the returned substring pointer |
- Precondition
- Neither dest nor src shall be a null pointer.
-
Neither dmax nor slen shall not be 0.
-
Neither dmax nor slen shall not be greater than RSIZE_MAX_STR.
- Return values
-
EOK | when successful operation, substring found. |
ESNULLP | when dest/src/substring is NULL pointer |
ESZEROL | when dmax/slen = 0 |
ESLEMAX | when dmax/slen > RSIZE_MAX_STR |
ESNOTFND | when substring not found |
- See also
- strprefix_s(), strspn_s(), strcspn_s(), strpbrk_s()