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

Go to the source code of this file.

Functions

size_t ft_strlcpy (char *dst, const char *src, size_t size)
 

Function Documentation

◆ ft_strlcpy()

size_t ft_strlcpy ( char *  dst,
const char *  src,
size_t  size 
)

Definition at line 25 of file ft_strlcpy.c.

26{
27 char *d;
28 const char *s;
29 size_t n;
30
31 d = dst;
32 s = src;
33 n = size;
34 if (n > 0)
35 {
36 while (--n > 0 && *s != '\0')
37 *d++ = *s++;
38 *d = '\0';
39 }
40 while (*s != '\0')
41 s++;
42 return (s - src);
43}

Referenced by ft_strdup(), and ft_strndup().

Here is the caller graph for this function: