summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7ad0d6)
raw | patch | inline | side by side (parent: d7ad0d6)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 27 Mar 2007 14:10:16 +0000 (16:10 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 27 Mar 2007 14:10:16 +0000 (16:10 +0200) |
src/sensors.c | patch | blob | history |
diff --git a/src/sensors.c b/src/sensors.c
index 544afd1b37e256dfb87b1e2becba6738a70673ff..4b0fc3da2c695d67d0912c1b1b8d7d53097d175b 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
{ "3.3V", SENSOR_TYPE_VOLTAGE },
{ "2.5V", SENSOR_TYPE_VOLTAGE },
{ "2.0V", SENSOR_TYPE_VOLTAGE },
- { "12V", SENSOR_TYPE_VOLTAGE },
- { (char *) 0, SENSOR_TYPE_UNKNOWN }
+ { "12V", SENSOR_TYPE_VOLTAGE }
};
+static int known_features_num = STATIC_ARRAY_SIZE (known_features);
/* end new naming */
static const char *config_keys[] =
continue;
/* Only known features */
- for (i = 0; known_features[i].type >= 0; i++)
+ for (i = 0; i < known_features_num; i++)
{
if (strcmp (data->name, known_features[i].label) != 0)
continue;
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- if (ignorelist_match (sensor_list, type_instance))
+ if ((sensor_list != NULL)
+ && (ignorelist_match (sensor_list, type_instance)))
return;
values[0].gauge = val;