diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_s_lcom.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ft_s_lcom.c b/src/ft_s_lcom.c index 19e503b..737c6eb 100644 --- a/src/ft_s_lcom.c +++ b/src/ft_s_lcom.c @@ -17,19 +17,19 @@ t_lcom *ft_lcom_new(const char word[]) { - t_lcom nlcom; - char **words + t_lcom *nlcom; + char **words; - /* if (!(nlcom = (t_lcom*)malloc(sizeof(t_lcom)))) */ - /* { */ - /* return (NULL); */ - /* } */ + if (!(nlcom = (t_lcom*)malloc(sizeof(t_lcom)))) + { + return (NULL); + } if (!(words = ft_split(word, ' '))) { return (NULL); } - nlcom.com = words[0]; - nlcom.args = words + 1; - nlcom.next = NULL; - return (&nlcom); + nlcom->com = words[0]; + nlcom->args = words + 1; + nlcom->next = NULL; + return (nlcom); } |