home *** CD-ROM | disk | FTP | other *** search
- #define UNARGV_C
- #define LINT_ARGS
- #include <stdio.h>
-
- /* UNARGV.C Concatantate all argv entries into a single
- * string.
- */
-
- int unargv( argc, argv, dest, maxcount )
- char **argv, *dest;
- register int maxcount;
- {
- /* Turn argv into a single string, with a single ' ' seperating
- * each entry. maxcount is the maximum size of dest. Return
- * the number of characters put into dest.
- */
-
- register char *src;
- char *sdest = dest;
-
- while( --argc >= 0 && maxcount > 0 )
- {
- for( src = *argv++; *src && --maxcount > 0; )
- *dest++ = *src++ ;
-
- if( --maxcount > 0 && argc > 0 )
- *dest++ = ' ';
- }
-
- *dest = 0;
- return( dest - sdest );
- }
-