#ifndef lint
static char *RCSid = "$Header: /sequent2/empire/EMP/lib/gen/RCS/onearg.c,v 1.3 89/09/17 21:06:40 mr-frog Exp $";
#endif

/*
 * onearg.c
 *
 * returns non-negative integer, or -1 on error.
 *
 * from PSL Empire, 1985
 */

int
onearg(arg, prompt)
	char	*arg;
	char	*prompt;
{
	extern	char *getstring();
	int	n;

	if (arg == 0 || *arg == 0)
		if ((arg = getstring(prompt)) == 0)
			return -1;
	n = atoi(arg);
	if (n < 0)
		return -1;
	return n;
}
