X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/6c363f70858369b3dca6738f37654d1dfc5e8d0f..29a87ab833bc1b9214ec69d8c84421d5529038b7:/morse/morse.c diff --git a/morse/morse.c b/morse/morse.c index c3f2b136..f97de689 100644 --- a/morse/morse.c +++ b/morse/morse.c @@ -1,4 +1,4 @@ -/* $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 @@ -43,12 +43,13 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\ #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 #include +#include #include #include @@ -56,8 +57,8 @@ __RCSID("$NetBSD: morse.c,v 1.6 1998/11/18 14:22:32 hubertf Exp $"); #define MORSE_PERIOD ".-.-.-" -static char - *digit[] = { +static const char + *const digit[] = { "-----", ".----", "..---", @@ -69,7 +70,7 @@ static char "---..", "----.", }, - *alph[] = { + *const alph[] = { ".-", "-...", "-.-.", @@ -101,7 +102,7 @@ static char 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; @@ -114,6 +115,9 @@ main(argc, argv) int ch; char *s, *p; + /* Revoke setgid privileges */ + setgid(getgid()); + while ((ch = getopt(argc, argv, "ds")) != -1) switch((char)ch) { case 'd': @@ -188,7 +192,7 @@ decode(s) putchar('.'); } else { int found; - char **a; + const char *const *a; int size; int i; @@ -242,7 +246,7 @@ morse(c) void show(s) - char *s; + const char *s; { if (sflag) printf(" %s", s);