MCPcopy Create free account
hub / github.com/coreboot/coreboot / strchr

Function strchr

payloads/libpayload/libc/string.c:189–199  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

187 * string, or NULL if the character was not encountered within the string.
188 */
189char *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.

Callers 5

parse_long_optionsFunction · 0.70
getopt_internalFunction · 0.70
strsepFunction · 0.70
pci_filter_parse_slotFunction · 0.50
gdb_message_tokenizeFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected