home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
235_02
/
string.c
< prev
next >
Wrap
Text File
|
1987-06-17
|
896b
|
37 lines
/* 003 14-Feb-87 string.c
Common string related functions.
Copyright (c) 1987 by Blue Sky Software. All rights reserved.
*/
#ifndef NULL
#define NULL (0)
#endif
/*****************************************************************************
S T R C P Y F I L L
*****************************************************************************/
char *
strcpyfill(to,from,fldlen,fillch) /* copy a string with char fill */
char *from;
register char *to;
int fldlen, fillch;
{
char *to_where;
register int len;
to_where = to;
len = strlen(from);
if (len < fldlen) {
strncpy(to,from,len);
for (to+=len; len < fldlen; len++)
*to++ = fillch;
} else
strncpy(to,from,fldlen);
return(to_where);
}