-/* $NetBSD: morse.c,v 1.6 1998/11/18 14:22:32 hubertf Exp $ */
+/* $NetBSD: morse.c,v 1.10 2000/07/03 03:57:42 matt Exp $ */
/*
* Copyright (c) 1988, 1993
#if 0
static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: morse.c,v 1.6 1998/11/18 14:22:32 hubertf Exp $");
+__RCSID("$NetBSD: morse.c,v 1.10 2000/07/03 03:57:42 matt Exp $");
#endif
#endif /* not lint */
#include <ctype.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define MORSE_PERIOD ".-.-.-"
-static char
- *digit[] = {
+static const char
+ *const digit[] = {
"-----",
".----",
"..---",
"---..",
"----.",
},
- *alph[] = {
+ *const alph[] = {
".-",
"-...",
"-.-.",
int main __P((int, char *[]));
void morse __P((int));
void decode __P((const char *));
-void show __P((char *));
+void show __P((const char *));
static int sflag;
static int dflag;
int ch;
char *s, *p;
+ /* Revoke setgid privileges */
+ setgid(getgid());
+
while ((ch = getopt(argc, argv, "ds")) != -1)
switch((char)ch) {
case 'd':
putchar('.');
} else {
int found;
- char **a;
+ const char *const *a;
int size;
int i;
void
show(s)
- char *s;
+ const char *s;
{
if (sflag)
printf(" %s", s);