When the third arg to fwrite() is a size in bytes, then the second arg

should be 1.  sizeof(*mbuf) happens to equal 1, but it's better not
to rely on that.
This commit is contained in:
apb 2014-03-28 18:27:14 +00:00
parent fa823f4eed
commit 292aec205d
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: shutdown.c,v 1.55 2011/08/27 18:54:39 joerg Exp $ */
/* $NetBSD: shutdown.c,v 1.56 2014/03/28 18:27:14 apb Exp $ */
/*
* Copyright (c) 1988, 1990, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1990, 1993\
#if 0
static char sccsid[] = "@(#)shutdown.c 8.4 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: shutdown.c,v 1.55 2011/08/27 18:54:39 joerg Exp $");
__RCSID("$NetBSD: shutdown.c,v 1.56 2014/03/28 18:27:14 apb Exp $");
#endif
#endif /* not lint */
@ -331,7 +331,7 @@ timewarn(time_t timeleft)
(void)fprintf(pf, "System going down IMMEDIATELY\n\n");
if (mbuflen)
(void)fwrite(mbuf, sizeof(*mbuf), mbuflen, pf);
(void)fwrite(mbuf, 1, mbuflen, pf);
/*
* play some games, just in case wall doesn't come back