summaryrefslogtreecommitdiff
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-02-23 22:24:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-02-23 22:24:23 +0000
commit07449c30cf2f703743a1610312e9d58a2dd49709 (patch)
tree01be1cd8881a9503dcb5a6e42d3ddff805db17f6 /usr.bin/systat
parentc4a281f27a1841a402ade0fbf105595a914124f0 (diff)
leave unspecified fields blank; ok deanna
also, fix two logic errors in switches.
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/sensors.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c
index b869ba683fe..95fe1012258 100644
--- a/usr.bin/systat/sensors.c
+++ b/usr.bin/systat/sensors.c
@@ -161,6 +161,7 @@ printline(void)
mvwprintw(wnd, row, 24, "%15s", drvstat[sensor.value]);
break;
}
+ break;
case SENSOR_TIMEDELTA:
mvwprintw(wnd, row, 24, "%10.6f secs",
sensor.value / 1000000000.0);
@@ -171,29 +172,26 @@ printline(void)
case SENSOR_AMPHOUR:
mvwprintw(wnd, row, 24, "%10.2f Ah", sensor.value / 1000000.0);
break;
- /* FALLTHROUGH */
default:
mvwprintw(wnd, row, 24, "%10lld", sensor.value);
+ break;
}
- if (sensor.desc != NULL && strlen(sensor.desc) < 1)
- mvwprintw(wnd, row, 58, "(%s%d)",
- sensor_type_s[sensor.type], sensor.numt);
- else
+ if (sensor.desc && strlen(sensor.desc) >= 1)
mvwprintw(wnd, row, 58, "(%s)", sensor.desc);
switch (sensor.status) {
case SENSOR_S_UNKNOWN:
- mvwaddstr(wnd, row++, 45, "unknown");
+ mvwaddstr(wnd, row, 45, "unknown");
break;
case SENSOR_S_WARN:
- mvwaddstr(wnd, row++, 45, "WARNING");
+ mvwaddstr(wnd, row, 45, "WARNING");
break;
case SENSOR_S_CRIT:
- mvwaddstr(wnd, row++, 45, "CRITICAL");
+ mvwaddstr(wnd, row, 45, "CRITICAL");
break;
- /* FALLTHROUGH */
- default:
- mvwaddstr(wnd, row++, 45, "OK");
+ case SENSOR_S_OK:
+ mvwaddstr(wnd, row, 45, "OK");
break;
}
+ row++;
}