summaryrefslogtreecommitdiffstats
path: root/robots
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-12 14:16:26 +0000
committerlukem <lukem@NetBSD.org>1997-10-12 14:16:26 +0000
commit5a5bf2abf0d9a42df55b7ff2d902b35e0dd9b7de (patch)
tree1d78c3a4f13dc797ebdf17fea1e48bd4068f92bf /robots
parenta0bb5b9abf33dc2d2220eb3bd6e79c964e92a1c1 (diff)
downloadbsdgames-darwin-5a5bf2abf0d9a42df55b7ff2d902b35e0dd9b7de.tar.gz
bsdgames-darwin-5a5bf2abf0d9a42df55b7ff2d902b35e0dd9b7de.tar.zst
bsdgames-darwin-5a5bf2abf0d9a42df55b7ff2d902b35e0dd9b7de.zip
deprecate bzero, rindex, etc. use symbolic constants in open()
Diffstat (limited to 'robots')
-rw-r--r--robots/main.c6
-rw-r--r--robots/make_level.c6
-rw-r--r--robots/robots.h3
-rw-r--r--robots/score.c12
4 files changed, 14 insertions, 13 deletions
diff --git a/robots/main.c b/robots/main.c
index ce0831b4..27263b9d 100644
--- a/robots/main.c
+++ b/robots/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 1997/10/12 14:09:58 lukem Exp $ */
+/* $NetBSD: main.c,v 1.7 1997/10/12 14:16:26 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: main.c,v 1.6 1997/10/12 14:09:58 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.7 1997/10/12 14:16:26 lukem Exp $");
#endif
#endif /* not lint */
@@ -74,7 +74,7 @@ main(ac, av)
setgid(getgid());
Scorefile = av[0];
# ifdef FANCY
- sp = rindex(Scorefile, '/');
+ sp = strrchr(Scorefile, '/');
if (sp == NULL)
sp = Scorefile;
if (strcmp(sp, "pattern_roll") == 0)
diff --git a/robots/make_level.c b/robots/make_level.c
index 55c29d3d..b67d4d74 100644
--- a/robots/make_level.c
+++ b/robots/make_level.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make_level.c,v 1.4 1997/10/12 14:09:58 lukem Exp $ */
+/* $NetBSD: make_level.c,v 1.5 1997/10/12 14:16:27 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)make_level.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: make_level.c,v 1.4 1997/10/12 14:09:58 lukem Exp $");
+__RCSID("$NetBSD: make_level.c,v 1.5 1997/10/12 14:16:27 lukem Exp $");
#endif
#endif /* not lint */
@@ -70,7 +70,7 @@ make_level()
cp->y = -1;
My_pos.y = -1;
- bzero(Field, sizeof Field);
+ memset(Field, 0, sizeof Field);
Min.y = Y_FIELDSIZE;
Min.x = X_FIELDSIZE;
Max.y = 0;
diff --git a/robots/robots.h b/robots/robots.h
index d56639cc..ec487375 100644
--- a/robots/robots.h
+++ b/robots/robots.h
@@ -1,4 +1,4 @@
-/* $NetBSD: robots.h,v 1.6 1997/10/12 14:10:04 lukem Exp $ */
+/* $NetBSD: robots.h,v 1.7 1997/10/12 14:16:28 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,6 +38,7 @@
# include <sys/ttydefaults.h>
# include <ctype.h>
# include <curses.h>
+# include <err.h>
# include <fcntl.h>
# include <pwd.h>
# include <setjmp.h>
diff --git a/robots/score.c b/robots/score.c
index 400b0f12..c43e4011 100644
--- a/robots/score.c
+++ b/robots/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.4 1997/10/12 14:10:05 lukem Exp $ */
+/* $NetBSD: score.c,v 1.5 1997/10/12 14:16:28 lukem Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.4 1997/10/12 14:10:05 lukem Exp $");
+__RCSID("$NetBSD: score.c,v 1.5 1997/10/12 14:16:28 lukem Exp $");
#endif
#endif /* not lint */
@@ -66,8 +66,8 @@ score()
static int numscores, max_uid;
Newscore = FALSE;
- if ((inf = open(Scorefile, 2)) < 0) {
- perror(Scorefile);
+ if ((inf = open(Scorefile, O_RDWR)) < 0) {
+ warn("opening `%s'", Scorefile);
return;
}
@@ -167,8 +167,8 @@ show_score()
int inf;
static int max_score;
- if ((inf = open(Scorefile, 0)) < 0) {
- perror(Scorefile);
+ if ((inf = open(Scorefile, O_RDONLY)) < 0) {
+ warn("opening `%s'", Scorefile);
return;
}