home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
328_02
/
wputfl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-25
|
668b
|
36 lines
/* WPUTFL.C - fixed length string put.
*/
#include "wsys.h"
void wputfl ( char *s, int l )
{
char ch;
char done =0;
#ifdef __LARGE__
if ( s==NULL ) s= ""; /* protect against ptr to NULL */
#endif
#ifdef __COMPACT__
if ( s==NULL ) s= ""; /* protect against ptr to NULL */
#endif
#ifdef __HUGE__
if ( s==NULL ) s= ""; /* protect against ptr to NULL */
#endif
while ( l-- )
{
if ( ! done )
{
ch = *(s++); /* get value first, then incr. ptr */
if ( ch == 0 )
{
done =1;
ch = ' ';
}
}
wputc ( ch );
}
return; /* wputfl() */
}
/*---------------- WPUTFL.C -----------------*/