Example #1
0
void	ft_go_next(int vfi, int vfj, char **tab, int *ok, char ***tab2)
{
	if (vfj == 9)
	{
		vfi++;
		vfj = 0;
	}
	while (tab[vfi][vfj] != '.' && vfi < 9)
	{
		vfj++;
		if (vfj == 9)
		{
			vfi++;
			vfj = 0;
		}
	}
	if (vfi < 9)
		ft_back(vfi, vfj, tab, ok, tab2);
}
Example #2
0
char			*ft_strtrim(char const *s)
{
	int		front;
	int		back;
	int		len;
	char	*tmp1;

	if (!s)
		return (NULL);
	front = ft_front(s);
	back = ft_back(s);
	len = ft_strlen(s) - back - front;
	if (len < 0)
		return (ft_strdup(""));
	if (!(tmp1 = (char*)malloc(sizeof(char) * (len + 1))))
		return (NULL);
	tmp1 = ft_strsub(s, front, len);
	return (tmp1);
}