head 1.3; access; symbols; locks; strict; comment @ * @; 1.3 date 92.12.15.00.20.22; author jromine; state Exp; branches; next 1.2; 1.2 date 92.01.31.21.57.33; author jromine; state Exp; branches; next 1.1; 1.1 date 92.01.31.21.57.13; author jromine; state Exp; branches; next ; desc @@ 1.3 log @endif sugar @ text @/* sprintb.c - sprintf a %b string */ #ifndef lint static char ident[] = "@@(#)$Id: sprintb.c,v 1.2 1992/01/31 21:57:33 jromine Exp jromine $"; #endif /* lint */ #include "../h/mh.h" #include char *sprintb (buffer, v, bits) register char *buffer, *bits; register unsigned v; { register int i, j; register char c, *bp; (void) sprintf (buffer, bits && *bits == 010 ? "0%o" : "0x%x", v); bp = buffer + strlen (buffer); if (bits && *++bits) { j = 0; *bp++ = '<'; while (i = *bits++) if (v & (1 << (i - 1))) { if (j++) *bp++ = ','; for (; (c = *bits) > 32; bits++) *bp++ = c; } else for (; *bits > 32; bits++) continue; *bp++ = '>'; *bp = 0; } return buffer; } @ 1.2 log @kerberos @ text @d3 2 a4 2 static char ident[] = "@@(#)$Id: m_getfld.c,v 1.10 1992/01/31 21:54:32 jromine Exp $"; #endif lint @ 1.1 log @Initial revision @ text @d2 3 d37 1 a37 1 *bp = NULL; @