2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
13 extern char *long2str();
38 %[uxbo] = unsigned int
42 _format(buf
, fmt
, argp
)
44 register va_list argp
;
46 register char *pf
= fmt
;
47 register char *pb
= buf
;
51 register width
, base
, pad
, npad
;
54 char *badformat
= "<bad format>";
66 while (*pf
>= '0' && *pf
<= '9')
67 width
= 10 * width
+ *pf
++ - '0';
70 arg
= va_arg(argp
, char *);
74 cbuf
[0] = va_arg(argp
, int);
81 if (base
= integral(*++pf
)) {
82 arg
= long2str(va_arg(argp
,long), base
);
90 if (base
= integral(*pf
)) {
91 arg
= long2str((long)va_arg(argp
,int), base
);
99 npad
= width
- strlen(arg
);
104 while (*pb
++ = *arg
++);