Module Name: src
Committed By: dholland
Date: Sun Mar 30 02:11:25 UTC 2014
Modified Files:
src/games/hunt/hunt: playit.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/games/hunt/hunt/playit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/games/hunt/hunt/playit.c
diff -u src/games/hunt/hunt/playit.c:1.18 src/games/hunt/hunt/playit.c:1.19
--- src/games/hunt/hunt/playit.c:1.18 Sat Mar 29 21:24:26 2014
+++ src/games/hunt/hunt/playit.c Sun Mar 30 02:11:25 2014
@@ -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++;