Store the feature list length separately instead of null-terminating

the list. This make it possible to check for out-of-bound indexes
without walking the entire list, so that direct look-ups are safer.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4760 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-09-05 08:19:42 +00:00
1 parent 7975800ac1
commit 23f4274010
4 files changed
+15 -10

No files matched your search

+1
View File
@@ -143,6 +143,7 @@ typedef struct sensors_chip_feature {
typedef struct sensors_chip_features {
struct sensors_chip_name chip;
struct sensors_chip_feature *feature;
int feature_count;
} sensors_chip_features;
extern sensors_chip *sensors_config_chips;