summaryrefslogtreecommitdiffstats
path: root/src/c_utils.c
diff options
context:
space:
mode:
authorSalad <water_appreciator@protonmail.com>2020-10-19 17:32:53 +0200
committerSalad <water_appreciator@protonmail.com>2020-10-19 17:32:53 +0200
commit35ea2d4a8a529c8680891cd1aae8cfe0088dd284 (patch)
tree465f5be4e8900152151f384adeacb188e0b9c03a /src/c_utils.c
parentqsd (diff)
download42-minishell-35ea2d4a8a529c8680891cd1aae8cfe0088dd284.tar.gz
42-minishell-35ea2d4a8a529c8680891cd1aae8cfe0088dd284.tar.bz2
42-minishell-35ea2d4a8a529c8680891cd1aae8cfe0088dd284.tar.xz
42-minishell-35ea2d4a8a529c8680891cd1aae8cfe0088dd284.tar.zst
42-minishell-35ea2d4a8a529c8680891cd1aae8cfe0088dd284.zip
FIX ALL NIG
Diffstat (limited to '')
-rw-r--r--src/c_utils.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/c_utils.c b/src/c_utils.c
index b18b949..ad1ccba 100644
--- a/src/c_utils.c
+++ b/src/c_utils.c
@@ -120,16 +120,17 @@ static int16_t
tputs(tgetstr("up", NULL), 1, ft_putchar);
tputs(tgetstr("up", NULL), 1, ft_putchar);
tputs(tgetstr("cr", NULL), 1, ft_putchar);
- while (i <= (tcaps->cpos + plen))
+ while (i < (tcaps->cpos + plen))
{
tputs(tgetstr("nd", NULL), 1, ft_putchar);
i++;
}
}
else
- while (--len > tcaps->cpos)
+ while (len > tcaps->cpos)
{
tputs(tgetstr("le", NULL), 1, ft_putchar);
+ len--;
}
return (len);
}
@@ -147,12 +148,6 @@ int16_t
i = 0;
j = tcaps->lpos;
tputs(tgetstr("cr", NULL), 1, ft_putchar);
- if ((((tcaps->cpos + 1) + ft_strlen(msh->ps[tcaps->psx])) %
- tcaps->ws.ws_col) == 0)
- {
- tputs(tgetstr("sf", NULL), 1, ft_putchar);
- return (1);
- }
while (--j > 0)
{
tputs(tgetstr("sf", NULL), 1, ft_putchar);