diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-10-11 15:52:52 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-10-11 15:52:52 +0200 |
| commit | c98de126d2252fe47dc2a9094a5f9a8fa6b4b60a (patch) | |
| tree | 12f1c827ee063ed3e7038f6a704014e611e4f388 /libft/src/dstr/ft_dstrwrap.c | |
| parent | a4ceb5974d1b7dcdd12cc81b7eb07893ea16c8ad (diff) | |
| download | minishell-c98de126d2252fe47dc2a9094a5f9a8fa6b4b60a.tar.gz minishell-c98de126d2252fe47dc2a9094a5f9a8fa6b4b60a.tar.bz2 minishell-c98de126d2252fe47dc2a9094a5f9a8fa6b4b60a.zip | |
Removing libft/minishell_test submodules, Removing subject/README/etc
Diffstat (limited to 'libft/src/dstr/ft_dstrwrap.c')
| -rw-r--r-- | libft/src/dstr/ft_dstrwrap.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libft/src/dstr/ft_dstrwrap.c b/libft/src/dstr/ft_dstrwrap.c new file mode 100644 index 0000000..0acf684 --- /dev/null +++ b/libft/src/dstr/ft_dstrwrap.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_dstrwrap.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/06/09 17:32:30 by charles #+# #+# */ +/* Updated: 2020/06/09 17:33:57 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft_dstr.h" + +t_ftdstr *ft_dstrwrap(char *str) +{ + t_ftdstr *dstr; + + if ((dstr = (t_ftdstr*)malloc(sizeof(t_ftdstr))) == NULL) + return (NULL); + dstr->str = str; + dstr->length = ft_strlen(str); + dstr->capacity = dstr->length + 1; + return (dstr); +} |
