diff options
author | dholland <dholland@NetBSD.org> | 2009-06-07 20:13:18 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-06-07 20:13:18 +0000 |
commit | 9a33f5bfb221170e823efd3c33ab5d331baf7c74 (patch) | |
tree | 56cfd04dbcbacdc38273193be59800509d41bc7b /hack/hack.eat.c | |
parent | b462731cbc1198051cd39ad2f95b1027e441067d (diff) | |
download | bsdgames-darwin-9a33f5bfb221170e823efd3c33ab5d331baf7c74.tar.gz bsdgames-darwin-9a33f5bfb221170e823efd3c33ab5d331baf7c74.tar.zst bsdgames-darwin-9a33f5bfb221170e823efd3c33ab5d331baf7c74.zip |
sprintf -> snprintf, plus some use of strlcpy/strlcat where appropriate
XXX: there's still one sprintf left which will take some hacking to expunge.
Diffstat (limited to 'hack/hack.eat.c')
-rw-r--r-- | hack/hack.eat.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hack/hack.eat.c b/hack/hack.eat.c index 9cd24b22..b0c01f34 100644 --- a/hack/hack.eat.c +++ b/hack/hack.eat.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.eat.c,v 1.7 2009/06/07 18:30:39 dholland Exp $ */ +/* $NetBSD: hack.eat.c,v 1.8 2009/06/07 20:13:18 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hack.eat.c,v 1.7 2009/06/07 18:30:39 dholland Exp $"); +__RCSID("$NetBSD: hack.eat.c,v 1.8 2009/06/07 20:13:18 dholland Exp $"); #endif /* not lint */ #include "hack.h" @@ -330,7 +330,8 @@ gotit: eatx: if (multi < 0 && !nomovemsg) { static char msgbuf[BUFSZ]; - (void) sprintf(msgbuf, "You finished eating the %s.", + (void) snprintf(msgbuf, sizeof(msgbuf), + "You finished eating the %s.", ftmp->oc_name); nomovemsg = msgbuf; } |