Example #1
0
void	set_retcode(unsigned char ret_code)
{
	char	*s;

	handle_var(KV_SET, "?", (s = ft_litoa(ret_code)));
	ft_strdel(&s);
}
Example #2
0
File: l.c Project: gygy19/new_libft
char		*flag_l(t_string *string, short base)
{
	long long int		tmp;

	tmp = get_long_int(string);
	if (tmp < -9223372036854775807)
		return (min_long(string, base));
	if (tmp < 0)
	{
		tmp = -tmp;
		string->is_negative = 1;
	}
	if (base == 8)
		return (ft_itoabase(tmp, "01234567"));
	else if (base == 10)
		return (ft_litoa(tmp));
	else if (base == 16)
		return (ft_itoabase(tmp, "0123456789abcdef"));
	else if (base == 32)
		return (ft_itoabase(tmp, "0123456789ABCDEF"));
	return (NULL);
}