remis quelques headers et a la norme

This commit is contained in:
Hugo LAMY
2019-12-01 16:15:47 +01:00
parent 2d32889d63
commit 138f4a0dc2
151 changed files with 45 additions and 3229 deletions

27
srcs/add/ft_strnew.c Normal file
View File

@@ -0,0 +1,27 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/14 21:19:08 by hulamy #+# #+# */
/* Updated: 2019/11/21 17:00:30 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
/*
** create a new string of length size, fill with zero, and return pointer to it
*/
#include "libft.h"
char *ft_strnew(size_t size)
{
char *str;
if (!(str = (char *)malloc(sizeof(char) * (size + 1))))
return (NULL);
ft_bzero(str, size + 1);
return (str);
}