-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f920d81
commit 2aee72e
Showing
12 changed files
with
1 addition
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: ael-maaz <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2023/12/04 22:26:52 by ael-maaz #+# #+# */ | ||
/* Updated: 2024/04/07 22:38:21 by ael-maaz ### ########.fr */ | ||
/* Updated: 2024/04/07 22:48:36 by ael-maaz ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -40,33 +40,6 @@ int fcmp(const char *s1, const char *s2) | |
return (0); | ||
} | ||
|
||
char *ft_strnstr(const char *haystack, const char *needle, size_t len) | ||
{ | ||
size_t i; | ||
size_t j; | ||
size_t count; | ||
|
||
i = 0; | ||
count = ft_strlen((char *)needle); | ||
if (!haystack && len == 0 && needle) | ||
return (NULL); | ||
if (needle[0] == '\0') | ||
return ((char *)haystack); | ||
while (haystack[i] && i < len) | ||
{ | ||
j = 0; | ||
while (needle[j] == haystack[i + j] && i + j < len) | ||
{ | ||
if (j == count - 1 && needle[j] == haystack[i + j] | ||
&& haystack[i + j] != '\0') | ||
return ((char *)haystack + i); | ||
j++; | ||
} | ||
i++; | ||
} | ||
return (NULL); | ||
} | ||
|
||
int get_range(int size) | ||
{ | ||
int range; | ||
|
Binary file not shown.