summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/atrun.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-03-15 00:39:02 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-03-15 00:39:02 +0000
commitf5a7957305ac9d2273318b55c0809a89c963d2b4 (patch)
tree9525c8f5c0fa8f66ebefb677a4165438684a1d8f /usr.sbin/cron/atrun.c
parentf1d98055dcb74848e99477cbc7525a620e956e73 (diff)
Use strlcpy() instead of pre-checking the src len and using strcpy()
Diffstat (limited to 'usr.sbin/cron/atrun.c')
-rw-r--r--usr.sbin/cron/atrun.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/cron/atrun.c b/usr.sbin/cron/atrun.c
index a3d4cdb3770..9453e19a105 100644
--- a/usr.sbin/cron/atrun.c
+++ b/usr.sbin/cron/atrun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atrun.c,v 1.6 2003/02/20 20:38:08 millert Exp $ */
+/* $OpenBSD: atrun.c,v 1.7 2003/03/15 00:39:01 millert Exp $ */
/*
* Copyright (c) 2002-2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#if !defined(lint) && !defined(LINT)
-static const char rcsid[] = "$OpenBSD: atrun.c,v 1.6 2003/02/20 20:38:08 millert Exp $";
+static const char rcsid[] = "$OpenBSD: atrun.c,v 1.7 2003/03/15 00:39:01 millert Exp $";
#endif
#include "cron.h"
@@ -526,7 +526,7 @@ run_job(atjob *job, char *atfile)
(long)getpid()))
if (gethostname(hostname, sizeof(hostname)) != 0)
- strcpy(hostname, "unknown");
+ strlcpy(hostname, "unknown", sizeof(hostname));
if (snprintf(mailcmd, sizeof mailcmd, MAILFMT,
MAILARG) >= sizeof mailcmd) {
fprintf(stderr, "mailcmd too long\n");