aboutsummaryrefslogtreecommitdiff
path: root/ft_strndup.c
diff options
context:
space:
mode:
Diffstat (limited to 'ft_strndup.c')
-rw-r--r--ft_strndup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ft_strndup.c b/ft_strndup.c
index 0d4119a..0683dae 100644
--- a/ft_strndup.c
+++ b/ft_strndup.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/25 03:28:52 by cacharle #+# #+# */
-/* Updated: 2019/11/20 04:09:59 by cacharle ### ########.fr */
+/* Updated: 2019/11/20 04:15:44 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,9 @@
char *ft_strndup(const char *s1, size_t n)
{
+ char *clone;
+
if ((clone = ft_strnew(n)) == NULL)
return (NULL);
- return (ft_strncpy(clone, s, n));
+ return (ft_strncpy(clone, s1, n));
}