minishell
ft_strnlen.c File Reference
#include <stddef.h>
#include "ft_string.h"
Include dependency graph for ft_strnlen.c:

Go to the source code of this file.

Functions

size_t ft_strnlen (const char *str, size_t max_len)
 

Function Documentation

◆ ft_strnlen()

size_t ft_strnlen ( const char *  str,
size_t  max_len 
)

Definition at line 16 of file ft_strnlen.c.

17 {
18  size_t len;
19 
20  len = 0;
21  while (len < max_len && *str != '\0')
22  {
23  str++;
24  len++;
25  }
26  return (len);
27 }
Here is the caller graph for this function: