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".
5 /* $Id: format.c,v 1.9 1994/06/24 11:20:16 ceriel Exp $ */
10 extern char *long2str();
34 %[uxbo] = unsigned int
38 _format(buf, fmt, argp)
40 register va_list argp;
42 register char *pf = fmt;
43 register char *pb = buf;
47 register width, base, pad, npad;
50 char *badformat = "<bad format>";
62 while (*pf >= '0' && *pf <= '9')
63 width = 10 * width + *pf++ - '0';
66 arg = va_arg(argp, char *);
70 cbuf[0] = va_arg(argp, int);
77 if (base = integral(*++pf)) {
78 arg = long2str(va_arg(argp,long), base);
86 if (base = integral(*pf)) {
87 arg = long2str((long)va_arg(argp,int), base);
95 npad = width - strlen(arg);
100 while (*pb++ = *arg++);