X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/462fca95471224f85b85be911e72faee16cd1597..243fa308555a5f145e62d9fca67961a56cc5bf71:/trek/destruct.c diff --git a/trek/destruct.c b/trek/destruct.c index 6e85ef36..eac87c53 100644 --- a/trek/destruct.c +++ b/trek/destruct.c @@ -1,6 +1,8 @@ +/* $NetBSD: destruct.c,v 1.5 1999/09/08 21:45:32 jsm Exp $ */ + /* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,12 +33,19 @@ * SUCH DAMAGE. */ +#include #ifndef lint -/*static char sccsid[] = "from: @(#)destruct.c 5.5 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$Id: destruct.c,v 1.2 1993/08/01 18:50:42 mycroft Exp $"; +#if 0 +static char sccsid[] = "@(#)destruct.c 8.1 (Berkeley) 5/31/93"; +#else +__RCSID("$NetBSD: destruct.c,v 1.5 1999/09/08 21:45:32 jsm Exp $"); +#endif #endif /* not lint */ -# include "trek.h" +#include +#include +#include "trek.h" +#include "getpar.h" /* ** Self Destruct Sequence @@ -58,14 +67,19 @@ static char rcsid[] = "$Id: destruct.c,v 1.2 1993/08/01 18:50:42 mycroft Exp $"; ** Uses trace flag 41 */ -destruct() +/*ARGSUSED*/ +void +destruct(v) + int v __attribute__((__unused__)); { char checkpass[15]; - register int i, j; + int i, j; double zap; - if (damaged(COMPUTER)) - return (out(COMPUTER)); + if (damaged(COMPUTER)) { + out(COMPUTER); + return; + } printf("\n\07 --- WORKING ---\07\n"); sleep(3); /* output the count 10 9 8 7 6 */ @@ -80,8 +94,10 @@ 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 */