MCPcopy Create free account
hub / github.com/F-Stack/f-stack / strstr

Function strstr

freebsd/libkern/strstr.c:44–61  ·  view source on GitHub ↗

* Find the first occurrence of find in s. */

Source from the content-addressed store, hash-verified

42 * Find the first occurrence of find in s.
43 */
44char *
45strstr(const char *s, const char *find)
46{
47 char c, sc;
48 size_t len;
49
50 if ((c = *find++) != 0) {
51 len = strlen(find);
52 do {
53 do {
54 if ((sc = *s++) == '\0')
55 return (NULL);
56 } while (sc != c);
57 } while (strncmp(s, find, len) != 0);
58 s--;
59 }
60 return (__DECONST(char *, s));
61}

Callers 15

kld_isloadedFunction · 0.85
__thread_createFunction · 0.85
luaL_gsubFunction · 0.85
nvlist_prtctl_setfmtFunction · 0.85
is_watchdog_devFunction · 0.85
zfs_strip_partitionFunction · 0.85
get_sourceFunction · 0.85
zfs_add_optionFunction · 0.85
zfs_add_optionsFunction · 0.85
zfs_mount_atFunction · 0.85
libzfs_path_containsFunction · 0.85

Calls 1

strncmpFunction · 0.85

Tested by 9

process_optionsFunction · 0.68
ztest_get_zdb_binFunction · 0.68
ztest_run_zdbFunction · 0.68
print_ereport_lineFunction · 0.68
parse_entryFunction · 0.68
test_is_selectedFunction · 0.68
get_redis_versionFunction · 0.68