stdio.h defines BUFSIZ
[unix-history] / usr / src / usr.bin / f77 / libU77 / getarg_.c
CommitLineData
840ed54d 1/*
161423a6
RE
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
840ed54d 5 *
161423a6
RE
6 * @(#)getarg_.c 5.1 %G%
7 */
8
9/*
840ed54d
DW
10 * return a specified command line argument
11 *
12 * calling sequence:
13 * character*20 arg
14 * call getarg(k, arg)
15 * where:
16 * arg will receive the kth unix command argument
17*/
18
19getarg_(n, s, ls)
20long int *n;
21register char *s;
22long int ls;
23{
24extern int xargc;
25extern char **xargv;
26register char *t;
27register int i;
28
29if(*n>=0 && *n<xargc)
30 t = xargv[*n];
31else
32 t = "";
33for(i = 0; i<ls && *t!='\0' ; ++i)
34 *s++ = *t++;
35for( ; i<ls ; ++i)
36 *s++ = ' ';
37}