Code

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 48705989773c4994e7c4960104693b306f069b0d..285fb744748c64714aa7eed8948e2f5b73df73c3 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);