Browse Source

[fix] insert: Valgrind debug: snd split was reading too far.

Moul 2 years ago
parent
commit
d98c14b92f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/term_edition.c

+ 1 - 1
src/term_edition.c

@@ -15,7 +15,7 @@ void	insert(t_e *e)
 
 	e->pos += ft_strlen(e->key);
 	term_action("im");
-	snd = ft_strsub(e->cmd, e->pos - 1, e->len);
+	snd = ft_strsub(e->cmd, e->pos - 1, e->len - (e->pos - 1));
 	if (e->pos == e->len + 1)
 	{
 		ft_strdel(&snd);