Returns the index of the first character that is the same between dest and src.
The scanning stops at the fisrt null in dest or src, or after dmax characters.
- Parameters
-
| [in] | dest | pointer to string to compare against |
| [in] | dmax | restricted maximum length of string dest |
| [in] | src | pointer to the string to be compared to dest |
| [out] | index | pointer to returned index |
- Precondition
- Neither dest nor src shall be a null pointer.
-
indicator shall not be a null pointer.
-
dmax shall not be 0.
-
dmax shall not be greater than RSIZE_MAX_STR.
- Returns
- index to first same char, when the return code is OK
- Return values
-
| EOK | when index to first same char is returned |
| ESNULLP | when dst/src/index is NULL pointer |
| ESZEROL | when dmax = 0 |
| ESLEMAX | when dmax > RSIZE_MAX_STR |
| ESNOTFND | when not found |
- See also
- strfirstchar_s(), strfirstdiff_s(), strlastchar_s(), strlastdiff_s(), strlastsame_s()