summaryrefslogtreecommitdiffstats
path: root/robots
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-08-03 06:04:12 +0000
committerdholland <dholland@NetBSD.org>2009-08-03 06:04:12 +0000
commit534eafe581e5ce9b0b32d42642949f61f9cc61cf (patch)
tree22fa93661245161fc2a5d5a09179fed1324e35f6 /robots
parent2c922baaa93dfa561986acace5008e7d78d8c1fb (diff)
downloadbsdgames-darwin-534eafe581e5ce9b0b32d42642949f61f9cc61cf.tar.gz
bsdgames-darwin-534eafe581e5ce9b0b32d42642949f61f9cc61cf.tar.zst
bsdgames-darwin-534eafe581e5ce9b0b32d42642949f61f9cc61cf.zip
don't ignore errors from read(); found by lint
Diffstat (limited to 'robots')
-rw-r--r--robots/score.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/robots/score.c b/robots/score.c
index 7c74057e..f23bdc42 100644
--- a/robots/score.c
+++ b/robots/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.21 2009/07/20 06:39:06 dholland Exp $ */
+/* $NetBSD: score.c,v 1.22 2009/08/03 06:04:12 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.21 2009/07/20 06:39:06 dholland Exp $");
+__RCSID("$NetBSD: score.c,v 1.22 2009/08/03 06:04:12 dholland Exp $");
#endif
#endif /* not lint */
@@ -66,10 +66,9 @@ read_score(int inf)
{
SCORE *scp;
- if (read(inf, &max_uid, sizeof max_uid) == sizeof max_uid) {
+ if (read(inf, &max_uid, sizeof max_uid) == sizeof max_uid &&
+ read(inf, Top, sizeof Top) == sizeof Top) {
max_uid = ntohl(max_uid);
-
- read(inf, Top, sizeof Top);
for (scp = Top; scp < &Top[MAXSCORES]; scp++) {
scp->s_uid = ntohl(scp->s_uid);
scp->s_score = ntohl(scp->s_score);