wireless plugin: Fix reading the noise value.
authorFlorian Forster <octo@huhu.verplant.org>
Sat, 22 Mar 2008 09:45:11 +0000 (10:45 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Sat, 22 Mar 2008 09:45:11 +0000 (10:45 +0100)
Accidentally the wrong value was used as `noise'. This patch fixes it.
Thanks to Ondřej Válek for pointing this out.

src/wireless.c

index 4870598..285fb74 100644 (file)
@@ -132,8 +132,8 @@ static int wireless_read (void)
                        power = 1.0; /* invalid */
 
                /* noise [dBm] < 0.0 */
-               noise = strtod (fields[3], &endptr);
-               if (fields[3] == endptr)
+               noise = strtod (fields[4], &endptr);
+               if (fields[4] == endptr)
                        noise = 1.0; /* invalid */
                else if ((noise >= 0.0) && (noise <= 100.0))
                        noise = wireless_percent_to_power (noise);