xref: /csrg-svn/lib/libcompat/4.3/strout.c (revision 2034)
1*2034Swnj /* @(#)strout.c	4.1 (Berkeley) 12/21/80 */
2*2034Swnj #include	<stdio.h>
3*2034Swnj 
4*2034Swnj _strout(count, string, adjust, file, fillch)
5*2034Swnj register char *string;
6*2034Swnj register count;
7*2034Swnj int adjust;
8*2034Swnj register struct _iobuf *file;
9*2034Swnj {
10*2034Swnj 	while (adjust < 0) {
11*2034Swnj 		if (*string=='-' && fillch=='0') {
12*2034Swnj 			putc(*string++, file);
13*2034Swnj 			count--;
14*2034Swnj 		}
15*2034Swnj 		putc(fillch, file);
16*2034Swnj 		adjust++;
17*2034Swnj 	}
18*2034Swnj 	while (--count>=0)
19*2034Swnj 		putc(*string++, file);
20*2034Swnj 	while (adjust) {
21*2034Swnj 		putc(fillch, file);
22*2034Swnj 		adjust--;
23*2034Swnj 	}
24*2034Swnj }
25