BSD 4_1c_2 release
[unix-history] / usr / src / usr.lib / libF77 / getarg_.c
CommitLineData
840ed54d
DW
1/*
2char id_getarg[] = "@(#)getarg_.c 1.1";
3 *
4 * return a specified command line argument
5 *
6 * calling sequence:
7 * character*20 arg
8 * call getarg(k, arg)
9 * where:
10 * arg will receive the kth unix command argument
11*/
12
13getarg_(n, s, ls)
14long int *n;
15register char *s;
16long int ls;
17{
18extern int xargc;
19extern char **xargv;
20register char *t;
21register int i;
22
23if(*n>=0 && *n<xargc)
24 t = xargv[*n];
25else
26 t = "";
27for(i = 0; i<ls && *t!='\0' ; ++i)
28 *s++ = *t++;
29for( ; i<ls ; ++i)
30 *s++ = ' ';
31}