Beispiel #1
0
void		illegal2(char **av)
{
	ft_putstr2("hexdump: illegal offset -- ");
	if (ft_strcmp2(av[1], "-C") != 0)
		ft_putstr2(&av[1][2]);
	else
		ft_putstr2(av[2]);
	ft_putstr2("\n");
}
Beispiel #2
0
int		ft_putstr2(char *s)
{
	if (s == NULL)
		return (ft_putstr2("(null)"));
	write(1, s, ft_strlen(s));
	return (ft_strlen(s));
}
Beispiel #3
0
int		do_operation_map(char *save)
{
	t_dim dim;

	dim = set_dimension();
	if (check_array(save, &dim) == -1)
	{
		ft_putstr("map error\n");
		return (-1);
	}
	get_size(save, &dim);
	if (dim.width < 2 || dim.height < 2)
	{
		if (exeption_solver(save, dim) == 0)
			return (-1);
	}
	solver(save, &dim, (dim.width * dim.height + dim.height + dim.firstline));
	replace_square(save, &dim, dim.size_max_square, dim.pos_max_square);
	ft_putstr2(save);
	return (1);
}
Beispiel #4
0
void	ft_putnbr(int nb)
{
	if (nb == -2147483648)
	{
		ft_putstr2("-2147483648");
		return ;
	}
	if (nb < 0)
	{
		nb = nb * -1;
		ft_putchar('-');
	}
	if (nb >= 10)
	{
		ft_putnbr(nb / 10);
		ft_putnbr(nb % 10);
	}
	else if (nb <= 9 && nb >= 0)
	{
		ft_putchar(nb + '0');
	}
}