home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
msdos
/
c
/
jazlib.arc
/
JZMIDSTR.C
< prev
next >
Wrap
Text File
|
1986-07-11
|
818b
|
31 lines
/*
┌────────────────────────────────────────────────────────────────────────────┐
│jzmidstr.c │
│Return the substring of a string. │
│Specify the String, the starting position, and the number of chars to copy │
│ │
│ (C) JazSoft Software by Jack A. Zucker (301) 794-5950 │
└────────────────────────────────────────────────────────────────────────────┘
*/
char *jzmidstr(fstr,ffrom,flen)
char *fstr;
int ffrom,flen;
{
static char wstr[256]; /* static work buffer */
unsigned int wlen,newlen;
if ((wlen = strlen(fstr)) < (ffrom+1)) /* don't go beyond string */
return(0);
strncpy(wstr, fstr + ffrom, flen); /* copy into work storage */
newlen = flen - ffrom + 1;
if (newlen >= flen)
wstr[newlen] = 0;
return(wstr);
}