Module Name:    src
Committed By:   christos
Date:           Sat Apr  4 18:43:01 UTC 2009

Modified Files:
        src/usr.sbin/envstat: envstat.c

Log Message:
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.71 -r1.72 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.71 src/usr.sbin/envstat/envstat.c:1.72
--- src/usr.sbin/envstat/envstat.c:1.71	Sat Feb 14 11:08:22 2009
+++ src/usr.sbin/envstat/envstat.c	Sat Apr  4 14:43:01 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: envstat.c,v 1.71 2009/02/14 16:08:22 ahoka Exp $ */
+/* $NetBSD: envstat.c,v 1.72 2009/04/04 18:43:01 christos Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: envstat.c,v 1.71 2009/02/14 16:08:22 ahoka Exp $");
+__RCSID("$NetBSD: envstat.c,v 1.72 2009/04/04 18:43:01 christos Exp $");
 #endif /* not lint */
 
 #include <stdio.h>
@@ -990,9 +990,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;
 					}
@@ -1015,7 +1015,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