maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
ft_strstr.c File Reference
#include "libft.h"
Include dependency graph for ft_strstr.c:

Go to the source code of this file.

Functions

char * ft_strstr (const char *big, const char *little)
 

Function Documentation

◆ ft_strstr()

char * ft_strstr ( const char *  big,
const char *  little 
)

Definition at line 24 of file ft_strstr.c.

25{
26 size_t little_len;
27
28 if (!big)
29 return (NULL);
30 little_len = ft_strlen(little);
31 if (little[0] == '\0')
32 return ((char *)big);
33 while (*big != '\0')
34 {
35 if (ft_strncmp(big, little, little_len) == 0)
36 return ((char *)big);
37 big++;
38 }
39 return (NULL);
40}
int ft_strncmp(const char *s1, const char *s2, size_t n)
Definition ft_strncmp.c:24
size_t ft_strlen(const char *s)
Definition ft_strlen.c:15

References ft_strlen(), and ft_strncmp().

Here is the call graph for this function: