4.3BSD/usr/ingres/source/gutil/itoa.c

Compare this file to the similar file:
Show the results in this format:

# include	<sccs.h>

SCCSID(@(#)itoa.c	8.1	12/31/84)

/*
**  ITOA -- integer to ascii conversion
*/

itoa(i, a)
register int	i;
register char	*a;
{
	register char	*j;
	char		b[6];

	if (i < 0)
	{
		*a++ = '-';
		i = -i;
	}
	j = &b[5];
	*j-- = 0;
	do
	{
		*j-- = i % 10 + '0';
		i /= 10;
	} while (i);
	do
	{
		*a++ = *++j;
	} while (*j);
	return (0);
}