From 5fde8545d5448ca168c8468702783c656e46ce7c Mon Sep 17 00:00:00 2001 From: henning Date: Mon, 15 Mar 2004 15:53:19 +0000 Subject: add a default: case to the switch (sensor type) in the config file parser that just errs out if someone tries to configure limits for a sensor type we do not support, deraadt ok --- usr.sbin/sensorsd/sensorsd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.sbin/sensorsd/sensorsd.c') diff --git a/usr.sbin/sensorsd/sensorsd.c b/usr.sbin/sensorsd/sensorsd.c index 83043b16db7..30bf43566e4 100644 --- a/usr.sbin/sensorsd/sensorsd.c +++ b/usr.sbin/sensorsd/sensorsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensorsd.c,v 1.8 2004/02/07 16:50:04 deraadt Exp $ */ +/* $OpenBSD: sensorsd.c,v 1.9 2004/03/15 15:53:19 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -309,6 +309,9 @@ get_val(char *buf, int upper, enum sensor_type type) errx(1, "unknown unit %s for voltage sensor", p); rval = val * 1000 * 1000; break; + default: + errx(1, "unsupported sensor type"); + /* not reached */ } free(buf); return (rval); -- cgit v1.2.3-59-g8ed1b