libft function safety