* Copyright (c) 1989 The Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)bpad.c 5.2 (Berkeley) %G%";
* the format string has no more data to print out. Go through
* the rest of the format string, and, for all non-%s conversions,
* replace with %s and remove any conversion flags that don't
* apply to %s. This should replace any output with an equivalent
for (; pr
; pr
= pr
->nextpr
) {
/* remove conversion flags %s can't handle. */
for (p1
= p2
= pr
->fmt
; *p1
; *p2
++ = *p1
++)
static char *spec1
= "-0+ #";
static char *spec2
= ".0123456789";
while (index(spec1
, *++p1
))
while (index(spec2
, *p2
++ = *p1
++));