File:  [CSRG BSD Unix] / 42BSD / ingres / source / libq / IIitos.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:53 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD42
BSD 4.2

# include	<sccs.h>

SCCSID(@(#)IIitos.c	7.1	2/5/81)


/*
**  INTEGER OUTPUT CONVERSION
**
**	The integer `i' is converted to ascii and put
**	into the static buffer `buf'.  The address of the starting
**	point in `buf' is
**	returned.
**
**	Number is converted from least significant forwards.
*/

char *IIitos(i1)
int	i1;
{
	register char	*a;
	register int	i;
	static char	buf[25];

	i = i1;
	if (i < 0)
		i = -i;

	a = &buf[sizeof buf - 1];
	*a-- = '\0';
	do
	{
		*a-- = i % 10 + '0';
		i /= 10;
	} while (i);
	if (i1 < 0)
		*a-- = '-';

	a++;
	return (a);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.