23 lines
1.0 KiB
C
23 lines
1.0 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strndup.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2018/04/23 15:44:36 by tmaze #+# #+# */
|
|
/* Updated: 2018/04/23 15:45:12 by tmaze ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *ft_strndup(const char *s1, size_t n)
|
|
{
|
|
char *ret;
|
|
|
|
if ((ret = ft_strnew(n)) != NULL)
|
|
ft_strncpy(ret, s1, n);
|
|
return (ret);
|
|
}
|