summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-11-04 21:22:11 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-11-04 21:22:11 +0000
commitc21958d4beca24b0b13f148c937df4785a064d44 (patch)
tree8fe7dd8b70c0c9fef91ff9ae1b923134d6c2abdf /games
parentd3037ce85fdf672ecf23feb9122711d0bfff6ad9 (diff)
replace setbuf with setvbuf, from Frederic Nowak
Diffstat (limited to 'games')
-rw-r--r--games/atc/graphics.c4
-rw-r--r--games/gomoku/main.c4
-rw-r--r--games/hack/hack.main.c4
-rw-r--r--games/mille/mille.c4
-rw-r--r--games/mille/move.c4
-rw-r--r--games/mille/varpush.c4
-rw-r--r--games/random/random.c4
-rw-r--r--games/worm/worm.c4
8 files changed, 16 insertions, 16 deletions
diff --git a/games/atc/graphics.c b/games/atc/graphics.c
index c9ba0b577a9..eb8fa104ac8 100644
--- a/games/atc/graphics.c
+++ b/games/atc/graphics.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: graphics.c,v 1.9 2014/07/13 13:00:40 tedu Exp $ */
+/* $OpenBSD: graphics.c,v 1.10 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $ */
/*-
@@ -117,7 +117,7 @@ setup_screen(const C_SCREEN *scp)
endwin();
errx(1, "screen too small.");
}
- setbuf(stdout, buffer);
+ setvbuf(stdout, buffer, _IOFBF, sizeof buffer);
input = newwin(INPUT_LINES, COLS - PLANE_COLS, LINES - INPUT_LINES, 0);
credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES,
COLS - PLANE_COLS);
diff --git a/games/gomoku/main.c b/games/gomoku/main.c
index 735446e40dd..e927e7005fd 100644
--- a/games/gomoku/main.c
+++ b/games/gomoku/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.27 2014/12/07 19:56:19 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.28 2015/11/04 21:22:10 tedu Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@@ -155,7 +155,7 @@ again:
clrtoeol();
}
} else {
- setbuf(stdout, 0);
+ setvbuf(stdout, NULL, _IONBF, 0);
get_line(buf, sizeof(buf));
if (strcmp(buf, "black") == 0)
color = BLACK;
diff --git a/games/hack/hack.main.c b/games/hack/hack.main.c
index a70659981a2..ca58f8ec830 100644
--- a/games/hack/hack.main.c
+++ b/games/hack/hack.main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hack.main.c,v 1.17 2015/09/27 05:13:11 guenther Exp $ */
+/* $OpenBSD: hack.main.c,v 1.18 2015/11/04 21:22:10 tedu Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -175,7 +175,7 @@ main(int argc, char **argv)
* Remember tty modes, to be restored on exit.
*/
gettty();
- setbuf(stdout,obuf);
+ setvbuf(stdout, obuf, _IOFBF, sizeof obuf);
umask(007);
startup();
cls();
diff --git a/games/mille/mille.c b/games/mille/mille.c
index 7fa5a08ecbc..eaccaae217d 100644
--- a/games/mille/mille.c
+++ b/games/mille/mille.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mille.c,v 1.20 2015/01/19 00:47:01 deraadt Exp $ */
+/* $OpenBSD: mille.c,v 1.21 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: mille.c,v 1.4 1995/03/24 05:01:48 cgd Exp $ */
/*
@@ -48,7 +48,7 @@ main(ac, av)
#ifdef DEBUG
if (strcmp(av[0], "a.out") == 0) {
outf = fopen("q", "w");
- setbuf(outf, (char *)NULL);
+ setvbuf(outf, NULL, _IONBF, 0);
Debug = TRUE;
}
#endif
diff --git a/games/mille/move.c b/games/mille/move.c
index 374e3c3b520..2f18d93a7f6 100644
--- a/games/mille/move.c
+++ b/games/mille/move.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: move.c,v 1.14 2015/10/24 17:51:59 mmcc Exp $ */
+/* $OpenBSD: move.c,v 1.15 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: move.c,v 1.4 1995/03/24 05:01:57 cgd Exp $ */
/*
@@ -442,7 +442,7 @@ over:
leaveok(Board, TRUE);
if ((outf = fopen(buf, "w")) == NULL)
warn("%s", buf);
- setbuf(outf, (char *)NULL);
+ setvbuf(outf, NULL, _IONBF, 0);
}
Debug = !Debug;
break;
diff --git a/games/mille/varpush.c b/games/mille/varpush.c
index ea3aa451cd4..7645d27d414 100644
--- a/games/mille/varpush.c
+++ b/games/mille/varpush.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: varpush.c,v 1.8 2015/01/19 00:47:01 deraadt Exp $ */
+/* $OpenBSD: varpush.c,v 1.9 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: varpush.c,v 1.4 1995/03/24 05:02:35 cgd Exp $ */
/*
@@ -85,7 +85,7 @@ over:
goto over;
}
if (strcmp(buf, _PATH_DEVNULL) != 0)
- setbuf(outf, (char *)NULL);
+ setvbuf(outf, NULL, _IONBF, 0);
}
#endif
} else {
diff --git a/games/random/random.c b/games/random/random.c
index ee5ce052bbe..a23942504b0 100644
--- a/games/random/random.c
+++ b/games/random/random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: random.c,v 1.13 2015/10/14 08:12:12 doug Exp $ */
+/* $OpenBSD: random.c,v 1.14 2015/11/04 21:22:10 tedu Exp $ */
/* $NetBSD: random.c,v 1.3 1995/04/22 07:44:05 cgd Exp $ */
/*
@@ -101,7 +101,7 @@ main(int argc, char *argv[])
* to write to the standard output.
*/
if (unbuffer_output)
- setbuf(stdout, NULL);
+ setvbuf(stdout, NULL, _IONBF, 0);
/*
* Select whether to print the first line. (Prime the pump.)
diff --git a/games/worm/worm.c b/games/worm/worm.c
index a6dc6ff78ef..b059245ab71 100644
--- a/games/worm/worm.c
+++ b/games/worm/worm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: worm.c,v 1.32 2015/08/26 01:25:57 rzalamena Exp $ */
+/* $OpenBSD: worm.c,v 1.33 2015/11/04 21:22:10 tedu Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -94,7 +94,7 @@ main(int argc, char **argv)
timespecclear(&t);
- setbuf(stdout, outbuf);
+ setvbuf(stdout, outbuf, _IOFBF, sizeof outbuf);
signal(SIGINT, leave);
signal(SIGQUIT, leave);
signal(SIGTSTP, suspend); /* process control signal */