home *** CD-ROM | disk | FTP | other *** search
- /*
- ┌────────────────────────────────────────────────────────────────────────────┐
- │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);
-
- }
-