mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 14:22:28 +00:00
Apply some touchups
This commit is contained in:
parent
9f149e1de3
commit
2f3bd90216
139 changed files with 1188 additions and 1154 deletions
|
@ -28,5 +28,15 @@
|
|||
* @see memmem()
|
||||
*/
|
||||
char *strstr(const char *haystack, const char *needle) {
|
||||
return memmem(haystack, strlen(haystack), needle, strlen(needle));
|
||||
size_t i;
|
||||
for (;;) {
|
||||
for (i = 0;;) {
|
||||
if (!needle[i]) return (/*unconst*/ char *)haystack;
|
||||
if (!haystack[i]) break;
|
||||
if (needle[i] != haystack[i]) break;
|
||||
++i;
|
||||
}
|
||||
if (!*haystack++) break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue