summaryrefslogtreecommitdiff
path: root/games/trek/destruct.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
commited884b9fa4509c09f0f7ab71efe57a4e83a2e055 (patch)
treeef9d859a0754785b42ea5cacb27aff54b5000315 /games/trek/destruct.c
parentf4fc9566a4d35c0cc2bf8c7f1136287d8eec8c44 (diff)
tags, formatting, ANSI-fication, prototypes, de-typos, and the occasional
initialization, removal of unused variable, or other minor fix. Most changes are from or inspired by NetBSD.
Diffstat (limited to 'games/trek/destruct.c')
-rw-r--r--games/trek/destruct.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/games/trek/destruct.c b/games/trek/destruct.c
index f4bee5c2feb..132d058b322 100644
--- a/games/trek/destruct.c
+++ b/games/trek/destruct.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: destruct.c,v 1.2 1998/08/19 07:41:25 pjanzen Exp $ */
/* $NetBSD: destruct.c,v 1.3 1995/04/22 10:58:44 cgd Exp $ */
/*
@@ -37,11 +38,14 @@
#if 0
static char sccsid[] = "@(#)destruct.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: destruct.c,v 1.3 1995/04/22 10:58:44 cgd Exp $";
+static char rcsid[] = "$OpenBSD: destruct.c,v 1.2 1998/08/19 07:41:25 pjanzen Exp $";
#endif
#endif /* not lint */
-# include "trek.h"
+#include <stdio.h>
+#include <unistd.h>
+#include "trek.h"
+#include "getpar.h"
/*
** Self Destruct Sequence
@@ -63,14 +67,19 @@ static char rcsid[] = "$NetBSD: destruct.c,v 1.3 1995/04/22 10:58:44 cgd Exp $";
** Uses trace flag 41
*/
-destruct()
+void
+destruct(v)
+ int v;
{
char checkpass[15];
register int i, j;
double zap;
if (damaged(COMPUTER))
- return (out(COMPUTER));
+ {
+ out(COMPUTER);
+ return;
+ }
printf("\n\07 --- WORKING ---\07\n");
sleep(3);
/* output the count 10 9 8 7 6 */
@@ -85,8 +94,11 @@ destruct()
skiptonl(0);
getstrpar("Enter password verification", checkpass, 14, 0);
sleep(2);
- if (!sequal(checkpass, Game.passwd))
- return (printf("Self destruct sequence aborted\n"));
+ if (strcmp(checkpass, Game.passwd) != 0)
+ {
+ printf("Self destruct sequence aborted\n");
+ return;
+ }
printf("Password verified; self destruct sequence continues:\n");
sleep(2);
/* output count 5 4 3 2 1 0 */