Module Name:    src
Committed By:   apb
Date:           Fri Mar 28 18:27:14 UTC 2014

Modified Files:
        src/sbin/shutdown: shutdown.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sbin/shutdown/shutdown.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/shutdown/shutdown.c
diff -u src/sbin/shutdown/shutdown.c:1.55 src/sbin/shutdown/shutdown.c:1.56
--- src/sbin/shutdown/shutdown.c:1.55	Sat Aug 27 18:54:39 2011
+++ src/sbin/shutdown/shutdown.c	Fri Mar 28 18:27:14 2014
@@ -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, 19
 #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

Reply via email to