2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 06:15:15 +00:00

Change the prototype of sensors_get_label(). Errors can be reported

with a NULL pointer.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4694 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2007-08-22 17:05:01 +00:00
parent 12655c1d85
commit 8bcdc331a0
8 changed files with 29 additions and 38 deletions

View File

@@ -91,7 +91,7 @@ void print_vid_info(const sensors_chip_name *name, int f_vid, int label_size)
char *label;
double vid;
if (!sensors_get_label(name, f_vid, &label)
if ((label = sensors_get_label(name, f_vid))
&& !sensors_get_feature(name, f_vid, &vid)) {
print_label(label, label_size);
printf("%+6.3f V\n", vid);
@@ -108,7 +108,7 @@ void print_unknown_chip(const sensors_chip_name *name)
a = 0;
while((data=sensors_get_all_features(name, &a))) {
if (sensors_get_label(name, data->number, &label)) {
if (!(label = sensors_get_label(name, data->number))) {
printf("ERROR: Can't get feature `%s' data!\n",data->name);
continue;
}