From 64a9fe90774294d537557da69be1f73ad32090d5 Mon Sep 17 00:00:00 2001 From: hubertf Date: Wed, 28 Jul 1999 02:12:33 +0000 Subject: This patch makes bcd(6) use `const' where appropriate, and use unsigned char rather than char for values that end up passed to isascii() and also used as array indices. Patch submitted by Joseph Myers in PR 8093. --- bcd/bcd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bcd') diff --git a/bcd/bcd.c b/bcd/bcd.c index 2625b261..4e0b70bb 100644 --- a/bcd/bcd.c +++ b/bcd/bcd.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcd.c,v 1.8 1999/07/21 03:59:41 hubertf Exp $ */ +/* $NetBSD: bcd.c,v 1.9 1999/07/28 02:12:33 hubertf Exp $ */ /* * Copyright (c) 1989, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)bcd.c 8.2 (Berkeley) 3/20/94"; #else -__RCSID("$NetBSD: bcd.c,v 1.8 1999/07/21 03:59:41 hubertf Exp $"); +__RCSID("$NetBSD: bcd.c,v 1.9 1999/07/28 02:12:33 hubertf Exp $"); #endif #endif /* not lint */ @@ -87,7 +87,7 @@ __RCSID("$NetBSD: bcd.c,v 1.8 1999/07/21 03:59:41 hubertf Exp $"); #include #include -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, @@ -160,9 +160,9 @@ void 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'))) -- cgit v1.2.3-56-ge451