* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / linux86-0.16.17 / libc / misc / ltoa.c
blobbe1c7e21211c36f4ed9c7d2a1f0708be48b079b2
1 /* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
2 * This file is part of the Linux-8086 C library and is distributed
3 * under the GNU Library General Public License.
4 */
6 static char buf[12];
8 extern char * ultoa();
10 char * ltoa(val)
11 long val;
13 char *p;
14 int flg = 0;
15 if( val < 0 ) { flg++; val= -val; }
16 p = ultoa(val);
17 if(flg) *--p = '-';
18 return p;
21 char * ultoa(val)
22 unsigned long val;
24 char *p;
26 p = buf+sizeof(buf);
27 *--p = '\0';
31 *--p = '0' + val%10;
32 val/=10;
34 while(val);
35 return p;