42-archive/nm-otool/libft2/srcs/str/ft_strndup.c
2017-10-07 17:49:14 +02:00

12 lines
168 B
C

#include "libft.h"
char *ft_strndup(const char *s1, size_t n)
{
char *dup;
if (!(dup = ft_memalloc(n)))
return (NULL);
ft_strncpy(dup, s1, n);
return (dup);
}