diff options
Diffstat (limited to 'hack/hack.shk.c')
-rw-r--r-- | hack/hack.shk.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hack/hack.shk.c b/hack/hack.shk.c index c24ecdc4..356a37f1 100644 --- a/hack/hack.shk.c +++ b/hack/hack.shk.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.shk.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */ +/* $NetBSD: hack.shk.c,v 1.10 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.shk.c,v 1.9 2009/06/07 18:30:39 dholland Exp $"); +__RCSID("$NetBSD: hack.shk.c,v 1.10 2009/06/07 20:13:18 dholland Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -816,17 +816,19 @@ doinvbill(int mode) thisused = bp->price * uquan; totused += thisused; obj->quan = uquan; /* cheat doname */ - (void) sprintf(buf, "x - %s", doname(obj)); + (void) snprintf(buf, sizeof(buf), + "x - %s", doname(obj)); obj->quan = oquan; /* restore value */ for (cnt = 0; buf[cnt]; cnt++); while (cnt < 50) buf[cnt++] = ' '; - (void) sprintf(&buf[cnt], " %5ld zorkmids", thisused); + (void) snprintf(buf+cnt, sizeof(buf)-cnt, + " %5ld zorkmids", thisused); if (page_line(buf)) goto quit; } } - (void) sprintf(buf, "Total:%50ld zorkmids", totused); + (void) snprintf(buf, sizeof(buf), "Total:%50ld zorkmids", totused); if (page_line("") || page_line(buf)) goto quit; set_pager(1); |