X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/927a087250c6d788d6df6cc7fcb0359653e2efd3..e96dede3c9ce08bd15f78e85132f88076cff177d:/trek/shield.c diff --git a/trek/shield.c b/trek/shield.c index d1030dbf..a14c22a7 100644 --- a/trek/shield.c +++ b/trek/shield.c @@ -1,4 +1,4 @@ -/* $NetBSD: shield.c,v 1.10 2009/05/24 21:44:56 dholland Exp $ */ +/* $NetBSD: shield.c,v 1.13 2009/08/12 08:54:54 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)shield.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: shield.c,v 1.10 2009/05/24 21:44:56 dholland Exp $"); +__RCSID("$NetBSD: shield.c,v 1.13 2009/08/12 08:54:54 dholland Exp $"); #endif #endif /* not lint */ @@ -59,7 +59,7 @@ __RCSID("$NetBSD: shield.c,v 1.10 2009/05/24 21:44:56 dholland Exp $"); ** so you get partial hits. */ -const struct cvntab Udtab[] = { +static const struct cvntab Udtab[] = { { "u", "p", (cmdfun)1, 0 }, { "d", "own", (cmdfun)0, 0 }, { NULL, NULL, NULL, 0 } @@ -80,7 +80,8 @@ shield(int f) if (f < 0) { /* cloaking device */ if (Ship.ship == QUEENE) { - printf("Ye Faire Queene does not have the cloaking device.\n"); + printf("Ye Faire Queene does not have the " + "cloaking device.\n"); return; } device = "Cloaking device"; @@ -110,9 +111,13 @@ shield(int f) i = (long) r->value; } else { if (*stat) - (void)sprintf(s, "%s %s up. Do you want %s down", device, dev2, dev3); + (void)snprintf(s, sizeof(s), + "%s %s up. Do you want %s down", + device, dev2, dev3); else - (void)sprintf(s, "%s %s down. Do you want %s up", device, dev2, dev3); + (void)snprintf(s, sizeof(s), + "%s %s down. Do you want %s up", + device, dev2, dev3); if (!getynpar(s)) return; i = !*stat;