Module Name:    src
Committed By:   simonb
Date:           Mon Nov 29 05:59:58 UTC 2021

Modified Files:
        src/bin/df: df.c

Log Message:
Set totals.f_frsize to DEV_BSIZE instead of totals.f_bsize so that
addstat() uses an initialised value for total size calculations.
Fixes core dump for "df -c".


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/bin/df/df.c

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

Modified files:

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.98 src/bin/df/df.c:1.99
--- src/bin/df/df.c:1.98	Sun Jan  3 01:43:12 2021
+++ src/bin/df/df.c	Mon Nov 29 05:59:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.98 2021/01/03 01:43:12 ginsbach Exp $ */
+/*	$NetBSD: df.c,v 1.99 2021/11/29 05:59:58 simonb Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)df.c	8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.98 2021/01/03 01:43:12 ginsbach Exp $");
+__RCSID("$NetBSD: df.c,v 1.99 2021/11/29 05:59:58 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -213,7 +213,7 @@ main(int argc, char *argv[])
 
 	if (cflag) {
 		memset(&totals, 0, sizeof(totals));
-		totals.f_bsize = DEV_BSIZE;
+		totals.f_frsize = DEV_BSIZE;
 		strlcpy(totals.f_mntfromname, "total",
 			sizeof(totals.f_mntfromname));
 	}

Reply via email to