summaryrefslogtreecommitdiff
path: root/games/robots
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-11-16 04:49:50 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-11-16 04:49:50 +0000
commitf2273a76226705a4e8f5e015d1835449da4e3242 (patch)
tree9aa8ab3b6fae60c8e2a7a05923b9b6f239d3f864 /games/robots
parent3243c629699c25f7f4a576fe1c2f58e274eba8f7 (diff)
Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,
and <sys/ttydefaults.h> Replace MAXPATHLEN with PATH_MAX and MAXLOGNAME with LOGIN_NAME_MAX Pull in <limits.h> where needed Prefer sizeof(var) over MAXFOO or FOO_MAX ok deraadt@
Diffstat (limited to 'games/robots')
-rw-r--r--games/robots/robots.h6
-rw-r--r--games/robots/score.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/games/robots/robots.h b/games/robots/robots.h
index 52aa374df92..67bebb8edcb 100644
--- a/games/robots/robots.h
+++ b/games/robots/robots.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: robots.h,v 1.7 2014/11/03 22:14:54 deraadt Exp $ */
+/* $OpenBSD: robots.h,v 1.8 2014/11/16 04:49:48 guenther Exp $ */
/* $NetBSD: robots.h,v 1.5 1995/04/24 12:24:54 cgd Exp $ */
/*
@@ -32,7 +32,6 @@
* @(#)robots.h 8.1 (Berkeley) 5/31/93
*/
-#include <sys/param.h>
#include <sys/types.h>
#include <sys/time.h>
#include <ctype.h>
@@ -40,6 +39,7 @@
#include <err.h>
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <pwd.h>
#include <signal.h>
#include <string.h>
@@ -85,7 +85,7 @@ typedef struct {
typedef struct {
uid_t s_uid;
int s_score;
- char s_name[MAXLOGNAME];
+ char s_name[LOGIN_NAME_MAX];
} SCORE;
typedef struct passwd PASSWD;
diff --git a/games/robots/score.c b/games/robots/score.c
index 2b9fae1532a..9b41adb7b49 100644
--- a/games/robots/score.c
+++ b/games/robots/score.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: score.c,v 1.10 2009/10/27 23:59:26 deraadt Exp $ */
+/* $OpenBSD: score.c,v 1.11 2014/11/16 04:49:48 guenther Exp $ */
/* $NetBSD: score.c,v 1.3 1995/04/22 10:09:12 cgd Exp $ */
/*
@@ -134,7 +134,7 @@ set_name(SCORE *scp)
if ((pp = getpwuid(scp->s_uid)) == NULL)
pp->pw_name = "???";
- strlcpy(scp->s_name, pp->pw_name, MAXLOGNAME);
+ strlcpy(scp->s_name, pp->pw_name, LOGIN_NAME_MAX);
}
/*