iio: Always set the scale

When calling process_scan_1(), make sure to always set the scale to 1.0
so it always has a default value.
This commit is contained in:
Bastien Nocera
2018-10-06 10:43:36 +02:00
committed by hadess
parent af44746c96
commit d7725e8b3a
2 changed files with 4 additions and 5 deletions

View File

@@ -533,6 +533,9 @@ process_scan_1 (char *data,
gboolean *ch_present)
{
int k;
*ch_scale = 1.0;
for (k = 0; k < buffer_data->channels_count; k++) {
if (strcmp (buffer_data->channels[k]->name, ch_name) != 0)
continue;
@@ -559,8 +562,6 @@ process_scan_1 (char *data,
*ch_val = (int) val;
if (buffer_data->channels[k]->scale)
*ch_scale = buffer_data->channels[k]->scale;
else
*ch_scale = 1.0;
*ch_present = TRUE;
}
break;