summaryrefslogtreecommitdiffstats
path: root/src/c_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c_utils.c')
-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);