/*
** Copyright 1998 - 1999 Double Precision, Inc.  See COPYING for
** distribution information.
*/

#include	<stdio.h>
#include	<stdlib.h>
#include	<string.h>
#include	<unistd.h>

#include	"auth.h"

static const char rcsid[] = "$Id: 271f1975447dad0f378b00beb86e8103f6bfbcda $";

char **authcopyargv(int c, char **oldv, char **prog)
{
char **v;
int	n;

	if ((v=(char **)malloc(sizeof(char *)*(c+1))) == 0)
	{
		perror("malloc");
		authexit(1);
	}
	for (n=0; n<c; n++)
		v[n]=oldv[n];
	v[c]=0;
	if (v[0])
	{
		*prog=v[0];
	}
	else
		*prog=0;

	return (v);
}
