* Find a character in a string. * * @param s The string. * @param c The character. * @return A pointer to the first occurrence of the character in the * string, or NULL if the character was not encountered within the string. */
| 187 | * string, or NULL if the character was not encountered within the string. |
| 188 | */ |
| 189 | char *strchr(const char *s, int c) |
| 190 | { |
| 191 | char *p = (char *)s; |
| 192 | |
| 193 | for (; *p != 0; p++) { |
| 194 | if (*p == c) |
| 195 | return p; |
| 196 | } |
| 197 | |
| 198 | return NULL; |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * Find a character in a string. |
no outgoing calls
no test coverage detected