summaryrefslogtreecommitdiffstats
path: root/dm/dm.c
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2001-01-25 20:41:41 +0000
committerjdolecek <jdolecek@NetBSD.org>2001-01-25 20:41:41 +0000
commit6960f46c01767d26122b09c41ce426e6cb433724 (patch)
tree88f9722aad3391c6b83816268baff42f90797454 /dm/dm.c
parent67d8db7069789ff841deda241dbdf183960935c1 (diff)
downloadbsdgames-darwin-6960f46c01767d26122b09c41ce426e6cb433724.tar.gz
bsdgames-darwin-6960f46c01767d26122b09c41ce426e6cb433724.tar.zst
bsdgames-darwin-6960f46c01767d26122b09c41ce426e6cb433724.zip
play(): use snprintf() instead of hard-to-parse strncpy() calls
Diffstat (limited to 'dm/dm.c')
-rw-r--r--dm/dm.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/dm/dm.c b/dm/dm.c
index 488110d8..e77a6d10 100644
--- a/dm/dm.c
+++ b/dm/dm.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm.c,v 1.15 1999/09/22 18:54:42 jsm Exp $ */
+/* $NetBSD: dm.c,v 1.16 2001/01/25 20:41:41 jdolecek Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
#if 0
static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: dm.c,v 1.15 1999/09/22 18:54:42 jsm Exp $");
+__RCSID("$NetBSD: dm.c,v 1.16 2001/01/25 20:41:41 jdolecek Exp $");
#endif
#endif /* not lint */
@@ -116,10 +116,7 @@ play(args)
{
char pbuf[MAXPATHLEN];
- (void)strncpy(pbuf, _PATH_HIDE, sizeof(pbuf) - 1);
- (void)strncpy(pbuf + sizeof(_PATH_HIDE) - 1, game,
- sizeof(pbuf) - sizeof(_PATH_HIDE) - 1);
- pbuf[sizeof(pbuf) - 1] = '\0';
+ snprintf(pbuf, sizeof(pbuf), "%s%s", _PATH_HIDE, game);
if (priority > 0) /* < 0 requires root */
(void)setpriority(PRIO_PROCESS, 0, priority);
execv(pbuf, args);