Module Name:    src
Committed By:   snj
Date:           Sat Apr  4 23:40:22 UTC 2009

Modified Files:
        src/usr.sbin/envstat [netbsd-5]: envstat.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #666):
        usr.sbin/envstat/envstat.c: revision 1.72
fix pasto: don't print the critcap when the warncap was asked. Also off by
one in length. From Anon-Ymous.
XXX: Should pull up to 5.0


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.70.4.1 src/usr.sbin/envstat/envstat.c

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

Modified files:

Index: src/usr.sbin/envstat/envstat.c
diff -u src/usr.sbin/envstat/envstat.c:1.70 src/usr.sbin/envstat/envstat.c:1.70.4.1
--- src/usr.sbin/envstat/envstat.c:1.70	Fri Aug 22 11:27:50 2008
+++ src/usr.sbin/envstat/envstat.c	Sat Apr  4 23:40:22 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: envstat.c,v 1.70 2008/08/22 11:27:50 pgoyette Exp $ */
+/* $NetBSD: envstat.c,v 1.70.4.1 2009/04/04 23:40:22 snj Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: envstat.c,v 1.70 2008/08/22 11:27:50 pgoyette Exp $");
+__RCSID("$NetBSD: envstat.c,v 1.70.4.1 2009/04/04 23:40:22 snj Exp $");
 #endif /* not lint */
 
 #include <stdio.h>
@@ -981,9 +981,9 @@
 						ilen = 16 + 1;
 					}
 					if (sensor->warncap_value) {
-						ilen = 24 + 2;
+						ilen = 24 + 2 - 1;
 						(void)printf("%*.2f%% ", (int)ilen,
-						    (sensor->critcap_value * 100.0) /
+						    (sensor->warncap_value * 100.0) /
 						    sensor->max_value);
 						ilen = 8;
 					}
@@ -1006,7 +1006,7 @@
 					}
 
 					if (sensor->critcap_value) {
-						ilen = 24 + 2;
+						ilen = 24 + 2 - 1;
 						(void)printf("%*.2f%% ", (int)ilen,
 						    (sensor->critcap_value * 100.0) /
 						    sensor->max_value);

Reply via email to