diff options
| author | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
|---|---|---|
| committer | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
| commit | a16f65c7d117419bd266c28a1901ef129a337569 (patch) | |
| tree | 2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /lib/libI77/fmtlib.c | |
| parent | 8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff) | |
Release FreeBSD 1.1upstream/1.1.0_cvsrelease/1.1.0_cvs
This commit was manufactured to restore the state of the 1.1-RELEASE image.
Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'lib/libI77/fmtlib.c')
| -rw-r--r-- | lib/libI77/fmtlib.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/libI77/fmtlib.c b/lib/libI77/fmtlib.c new file mode 100644 index 000000000000..37a4cc5f1d5a --- /dev/null +++ b/lib/libI77/fmtlib.c @@ -0,0 +1,28 @@ +/* @(#)fmtlib.c 1.2 */ +#define MAXINTLENGTH 23 +#ifdef KR_headers +char *f__icvt(value,ndigit,sign, base) long value; int *ndigit,*sign; + register int base; +#else +char *f__icvt(long value, int *ndigit, int *sign, int base) +#endif +{ static char buf[MAXINTLENGTH+1]; + register int i; + if(value>0) *sign=0; + else if(value<0) + { value = -value; + *sign= 1; + } + else + { *sign=0; + *ndigit=1; + buf[MAXINTLENGTH]='0'; + return(&buf[MAXINTLENGTH]); + } + for(i=MAXINTLENGTH-1;value>0;i--) + { *(buf+i)=(int)(value%base)+'0'; + value /= base; + } + *ndigit=MAXINTLENGTH-1-i; + return(&buf[i+1]); +} |
