-/* $NetBSD: bcd.c,v 1.7 1997/10/10 09:54:18 lukem Exp $ */
+/* $NetBSD: bcd.c,v 1.11 2000/07/03 03:57:40 matt Exp $ */
/*
* Copyright (c) 1989, 1993
#if 0
static char sccsid[] = "@(#)bcd.c 8.2 (Berkeley) 3/20/94";
#else
-__RCSID("$NetBSD: bcd.c,v 1.7 1997/10/10 09:54:18 lukem Exp $");
+__RCSID("$NetBSD: bcd.c,v 1.11 2000/07/03 03:57:40 matt Exp $");
#endif
#endif /* not lint */
#include <sys/types.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <unistd.h>
-u_short holes[256] = {
+const u_short holes[256] = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
{
char cardline[80];
+ /* revoke setgid privileges */
+ setgid(getgid());
+
/*
* The original bcd prompts with a "%" when reading from stdin,
* but this seems kind of silly. So this one doesn't.
printcard(str)
char *str;
{
- static char rowchars[] = " 123456789";
+ static const char rowchars[] = " 123456789";
int i, row;
- char *p;
+ unsigned char *p;
/* ruthlessly remove newlines and truncate at 48 characters. */
if ((p = strchr(str, '\n')))