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

Go to the source code of this file.

Functions

int ft_strncmp (const char *s1, const char *s2, size_t n)
 

Function Documentation

◆ ft_strncmp()

int ft_strncmp ( const char *  s1,
const char *  s2,
size_t  n 
)

Definition at line 24 of file ft_strncmp.c.

25{
26 while (n > 0 && (*s1 != '\0' || *s2 != '\0'))
27 {
28 if (*s1 != *s2)
29 return ((unsigned char)*s1 - (unsigned char)*s2);
30 s1++;
31 s2++;
32 n--;
33 }
34 return (0);
35}

Referenced by child_process(), ft_find_path(), ft_strnstr(), ft_strstr(), generate_prompt_string(), list_repeat_check_str(), and main_loop().

Here is the caller graph for this function: