diff options
Diffstat (limited to 'src/c_utils.c')
-rw-r--r-- | src/c_utils.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/c_utils.c b/src/c_utils.c index 43d6452..b39e580 100644 --- a/src/c_utils.c +++ b/src/c_utils.c @@ -24,10 +24,9 @@ /* ** TODO: -** quotes ** leaks on line +** quotes ** C-c -** tests varies ** NORME ** MULTILIGHNE ** term(0) on exit DONE @@ -83,19 +82,18 @@ uint16_t } int16_t - c_new_line(char *buf, - char **line, + c_new_line(char *line, t_msh *msh, t_caps *tcaps) { - write(1, buf, ft_strlen(buf)); + write(1, "\n", 1); tputs(tgetstr("cr", NULL), 1, ft_putchar); c_set_term_raw(0); if (line != NULL) { - m_parse_and_run_line(*line, msh); - *line = NULL; - free(*line); + m_parse_and_run_line(line, msh); + line = NULL; + free(line); } tcaps->cpos = 0; tputs(tgetstr("cr", NULL), 1, ft_putchar); @@ -133,8 +131,7 @@ char j++; } } - free(str); - dst[i] = '\0'; + ft_memdel((void**)&str); return (dst); } |