/* * Taken from: * linux/lib/string.c * * Copyright (C) 1991, 1992 Linus Torvalds */ #include <linux/types.h> #include <linux/string.h> #ifndef __HAVE_ARCH_STRSTR /** * strstr - Find the first substring in a %NUL terminated string * @s1: The string to be searched * @s2: The string to search for */
char *strstr(const char *s1, const char *s2) { size_t l1, l2; l2 = strlen(s2); if (!l2) return (char *)s1; l1 = strlen(s1); while (l1 >= l2) { l1--; if (!memcmp(s1, s2, l2)) return (char *)s1; s1++; } return NULL; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Ard Biesheuvel | 83 | 100.00% | 1 | 100.00% |
Total | 83 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Ard Biesheuvel | 70 | 100.00% | 1 | 100.00% |
Total | 70 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Ard Biesheuvel | 172 | 100.00% | 1 | 100.00% |
Total | 172 | 100.00% | 1 | 100.00% |