diff options
author | jdolecek <jdolecek@NetBSD.org> | 2001-01-25 20:41:41 +0000 |
---|---|---|
committer | jdolecek <jdolecek@NetBSD.org> | 2001-01-25 20:41:41 +0000 |
commit | 6960f46c01767d26122b09c41ce426e6cb433724 (patch) | |
tree | 88f9722aad3391c6b83816268baff42f90797454 /dm/dm.c | |
parent | 67d8db7069789ff841deda241dbdf183960935c1 (diff) | |
download | bsdgames-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.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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); |