diff options
author | dholland <dholland@NetBSD.org> | 2009-05-25 00:43:34 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-05-25 00:43:34 +0000 |
commit | 09d707fc69a7cdecdbb2f6c498d84d4ed6c7b5d8 (patch) | |
tree | 5e4673a62828b4cf913a24b494d13bfb2fadb99c /trek | |
parent | b32fa4c609c9e5c6586f3c870f5130a4c1b17a1f (diff) | |
download | bsdgames-darwin-09d707fc69a7cdecdbb2f6c498d84d4ed6c7b5d8.tar.gz bsdgames-darwin-09d707fc69a7cdecdbb2f6c498d84d4ed6c7b5d8.tar.zst bsdgames-darwin-09d707fc69a7cdecdbb2f6c498d84d4ed6c7b5d8.zip |
sprintf -> snprintf.
Diffstat (limited to 'trek')
-rw-r--r-- | trek/getpar.c | 6 | ||||
-rw-r--r-- | trek/shield.c | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/trek/getpar.c b/trek/getpar.c index b21973e3..be3f180b 100644 --- a/trek/getpar.c +++ b/trek/getpar.c @@ -1,4 +1,4 @@ -/* $NetBSD: getpar.c,v 1.16 2009/05/25 00:39:45 dholland Exp $ */ +/* $NetBSD: getpar.c,v 1.17 2009/05/25 00:43:34 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getpar.c,v 1.16 2009/05/25 00:39:45 dholland Exp $"); +__RCSID("$NetBSD: getpar.c,v 1.17 2009/05/25 00:43:34 dholland Exp $"); #endif #endif /* not lint */ @@ -197,7 +197,7 @@ getstrpar(const char *s, char *r, int l, const char *t) if (t == 0) t = " \t\n;"; - (void)sprintf(format, "%%%d[^%s]", l, t); + (void)snprintf(format, sizeof(format), "%%%d[^%s]", l, t); while (1) { if ((f = testnl()) && s) printf("%s: ", s); diff --git a/trek/shield.c b/trek/shield.c index ed484300..bcc31d2e 100644 --- a/trek/shield.c +++ b/trek/shield.c @@ -1,4 +1,4 @@ -/* $NetBSD: shield.c,v 1.11 2009/05/24 22:55:03 dholland Exp $ */ +/* $NetBSD: shield.c,v 1.12 2009/05/25 00:43:34 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.11 2009/05/24 22:55:03 dholland Exp $"); +__RCSID("$NetBSD: shield.c,v 1.12 2009/05/25 00:43:34 dholland Exp $"); #endif #endif /* not lint */ @@ -111,10 +111,12 @@ shield(int f) i = (long) r->value; } else { if (*stat) - (void)sprintf(s, "%s %s up. Do you want %s down", + (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", + (void)snprintf(s, sizeof(s), + "%s %s down. Do you want %s up", device, dev2, dev3); if (!getynpar(s)) return; |