diff options
author | Mike Pechkin <mpech@cvs.openbsd.org> | 2002-02-19 18:38:03 +0000 |
---|---|---|
committer | Mike Pechkin <mpech@cvs.openbsd.org> | 2002-02-19 18:38:03 +0000 |
commit | 1b7ac57ccea5e902a5153d8337c8476912eba485 (patch) | |
tree | 9ca417136ca87ef21c45e61611e84d935387b2a5 /usr.sbin/cron/do_command.c | |
parent | 210f400c2f86223b592e3c43ba8ec1e96cdeec91 (diff) |
Fix gethostname() usage.
deraadt@ ok
Diffstat (limited to 'usr.sbin/cron/do_command.c')
-rw-r--r-- | usr.sbin/cron/do_command.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/cron/do_command.c b/usr.sbin/cron/do_command.c index 5f5d1c88b49..e445e95af04 100644 --- a/usr.sbin/cron/do_command.c +++ b/usr.sbin/cron/do_command.c @@ -1,4 +1,4 @@ -/* $OpenBSD: do_command.c,v 1.12 2002/01/09 00:51:00 millert Exp $ */ +/* $OpenBSD: do_command.c,v 1.13 2002/02/19 18:38:02 mpech Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved */ @@ -21,7 +21,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$OpenBSD: do_command.c,v 1.12 2002/01/09 00:51:00 millert Exp $"; +static char rcsid[] = "$OpenBSD: do_command.c,v 1.13 2002/02/19 18:38:02 mpech Exp $"; #endif #include "cron.h" @@ -396,7 +396,7 @@ child_process(entry *e, user *u) { char mailcmd[MAX_COMMAND]; char hostname[MAXHOSTNAMELEN]; - gethostname(hostname, MAXHOSTNAMELEN); + gethostname(hostname, sizeof(hostname)); if (snprintf(mailcmd, sizeof mailcmd, MAILFMT, MAILARG) >= sizeof mailcmd) { fprintf(stderr, "mailcmd too long\n"); |