-/* $NetBSD: arithmetic.c,v 1.11 1998/09/13 15:27:25 hubertf Exp $ */
+/* $NetBSD: arithmetic.c,v 1.13 1999/07/17 19:11:30 hubertf Exp $ */
/*
* Copyright (c) 1989, 1993
#if 0
static char sccsid[] = "@(#)arithmetic.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: arithmetic.c,v 1.11 1998/09/13 15:27:25 hubertf Exp $");
+__RCSID("$NetBSD: arithmetic.c,v 1.13 1999/07/17 19:11:30 hubertf Exp $");
#endif
#endif /* not lint */
void showstats __P((void));
void usage __P((void)) __attribute__((__noreturn__));
-char keylist[] = "+-x/";
-char defaultkeys[] = "+-";
-char *keys = defaultkeys;
+const char keylist[] = "+-x/";
+const char defaultkeys[] = "+-";
+const char *keys = defaultkeys;
int nkeys = sizeof(defaultkeys) - 1;
int rangemax = 10;
int nright, nwrong;
extern int optind;
int ch, cnt;
+ /* Revoke setgid privileges */
+ setregid(getgid(), getgid());
+
while ((ch = getopt(argc, argv, "r:o:")) != -1)
switch(ch) {
case 'o': {
- char *p;
+ const char *p;
for (p = keys = optarg; *p; ++p)
if (!strchr(keylist, *p))
/* Handle interrupt character. Print score and exit. */
void
intr(dummy)
- int dummy;
+ int dummy __attribute__((__unused__));
{
showstats();
exit(0);