summaryrefslogtreecommitdiffstats
path: root/canfield
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2014-03-22 23:45:34 +0000
committerdholland <dholland@NetBSD.org>2014-03-22 23:45:34 +0000
commit2731042f1edda85aaaf6829392eda5e755cc8c33 (patch)
tree3a0f0d43a34f05c9cdf518f9a2dc4db2cde8b5f8 /canfield
parentcae864aa06264f96ed70bc6b2ae00026ea996981 (diff)
downloadbsdgames-darwin-2731042f1edda85aaaf6829392eda5e755cc8c33.tar.gz
bsdgames-darwin-2731042f1edda85aaaf6829392eda5e755cc8c33.tar.zst
bsdgames-darwin-2731042f1edda85aaaf6829392eda5e755cc8c33.zip
Use ssize_t for read() results. Don't use int for lseek() results.
Diffstat (limited to 'canfield')
-rw-r--r--canfield/cfscores/cfscores.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/canfield/cfscores/cfscores.c b/canfield/cfscores/cfscores.c
index b1c60ab0..115a02ac 100644
--- a/canfield/cfscores/cfscores.c
+++ b/canfield/cfscores/cfscores.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cfscores.c,v 1.21 2010/01/03 17:08:45 dholland Exp $ */
+/* $NetBSD: cfscores.c,v 1.22 2014/03/22 23:45:34 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
#if 0
static char sccsid[] = "@(#)cfscores.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cfscores.c,v 1.21 2010/01/03 17:08:45 dholland Exp $");
+__RCSID("$NetBSD: cfscores.c,v 1.22 2014/03/22 23:45:34 dholland Exp $");
#endif
#endif /* not lint */
@@ -106,7 +106,7 @@ printuser(const struct passwd *pw, int printfail)
{
struct betinfo total;
off_t pos;
- int i;
+ ssize_t i;
pos = pw->pw_uid * (off_t)sizeof(struct betinfo);
/* test pos, not pw_uid; uid_t can be unsigned, which makes gcc warn */
@@ -114,9 +114,9 @@ printuser(const struct passwd *pw, int printfail)
warnx("Bad uid %d", (int)pw->pw_uid);
return;
}
- i = lseek(dbfd, pos, SEEK_SET);
- if (i < 0)
- warn("lseek %s", _PATH_SCORE);
+ if (lseek(dbfd, pos, SEEK_SET) < 0) {
+ warn("%s: lseek", _PATH_SCORE);
+ }
i = read(dbfd, &total, sizeof(total));
if (i < 0)
warn("read %s", _PATH_SCORE);