fix leaks del

This commit is contained in:
gwojda 2017-03-27 22:07:51 +02:00
parent 4aae2cd86d
commit 20f8fa1b26
3 changed files with 7 additions and 5 deletions

View file

@ -6,7 +6,7 @@
# By: jhalford <jack@crans.org> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/02/07 16:09:36 by jhalford #+# #+# #
# Updated: 2017/03/23 16:49:31 by gwojda ### ########.fr #
# Updated: 2017/03/27 21:59:31 by gwojda ### ########.fr #
# #
# **************************************************************************** #
@ -19,7 +19,7 @@ RM = /bin/rm -rf
W_FLAGS = -Wall -Wextra -Werror -g
D_FLAGS = -g
V_FLAGS = -fvisibility=hidden
V_FLAGS = #-fvisibility=hidden
FLAGS = $(W_FLAGS) $(D_FLAGS) $(V_FLAGS)
DELTA = $$(echo "$$(tput cols)-47"|bc)

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/16 16:14:46 by gwojda #+# #+# */
/* Updated: 2017/03/21 10:03:23 by gwojda ### ########.fr */
/* Updated: 2017/03/27 22:06:09 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/05 16:02:43 by gwojda #+# #+# */
/* Updated: 2017/03/21 10:14:46 by gwojda ### ########.fr */
/* Updated: 2017/03/27 22:07:39 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -52,7 +52,7 @@ static void ft_suppr_2(char **str, size_t *i, size_t tmp)
++(*i);
ft_putnc('\b', *i - tmp);
(*i) = tmp;
if (ft_strlen(*str) == 0)
if (!**str)
ft_strdel(str);
}
@ -105,5 +105,7 @@ int ft_del(char **str, size_t *pos)
++(*pos);
ft_putnc('\b', *pos - tmp);
*pos = tmp;
if (!**str)
ft_strdel(str);
return (0);
}