1 /* sprintb.c - sprintf a %b string */
3 static char ident[] = "@(#)$Id: sprintb.c,v 1.3 1992/12/15 00:20:22 jromine Exp $";
10 char *sprintb (buffer, v, bits)
11 register char *buffer,
20 (void) sprintf (buffer, bits && *bits == 010 ? "0%o" : "0x%x", v);
21 bp = buffer + strlen (buffer);
23 if (bits && *++bits) {
27 if (v & (1 << (i - 1))) {
30 for (; (c = *bits) > 32; bits++)
34 for (; *bits > 32; bits++)