summaryrefslogtreecommitdiffstats
path: root/hunt
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2014-03-30 02:11:25 +0000
committerdholland <dholland@NetBSD.org>2014-03-30 02:11:25 +0000
commitacab9d9e10a833b800e8722c81c902a170f427bf (patch)
treeeba9ba84c0d64a3eb3e63f92d4e18db342d856e9 /hunt
parent49c27d0ce015c82ce7d2e4c36edf731592406617 (diff)
downloadbsdgames-darwin-acab9d9e10a833b800e8722c81c902a170f427bf.tar.gz
bsdgames-darwin-acab9d9e10a833b800e8722c81c902a170f427bf.tar.zst
bsdgames-darwin-acab9d9e10a833b800e8722c81c902a170f427bf.zip
When indexing an array with a char, cast it to unsigned char, not int,
to not only silence the compiler warning but also get the correct behavior.
Diffstat (limited to 'hunt')
-rw-r--r--hunt/hunt/playit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hunt/hunt/playit.c b/hunt/hunt/playit.c
index 4f52131c..ec702599 100644
--- a/hunt/hunt/playit.c
+++ b/hunt/hunt/playit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: playit.c,v 1.18 2014/03/29 21:24:26 dholland Exp $ */
+/* $NetBSD: playit.c,v 1.19 2014/03/30 02:11:25 dholland Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: playit.c,v 1.18 2014/03/29 21:24:26 dholland Exp $");
+__RCSID("$NetBSD: playit.c,v 1.19 2014/03/30 02:11:25 dholland Exp $");
#endif /* not lint */
#include <sys/file.h>
@@ -261,7 +261,7 @@ send_stuff(void)
Buf[count] = '\0';
nsp = inp;
for (sp = Buf; *sp != '\0'; sp++)
- if ((*nsp = map_key[(int)*sp]) == 'q')
+ if ((*nsp = map_key[(unsigned char)*sp]) == 'q')
intr(0);
else
nsp++;