File wavemon-10_dBM_fix.diff of Package wavemon

diff -ur wavemon-0.4.0b/iw_if.c wavemon-0.4.0b-pm/iw_if.c
--- wavemon-0.4.0b/iw_if.c	2007-06-16 16:19:37.937442114 +0100
+++ wavemon-0.4.0b-pm/iw_if.c	2007-06-16 16:19:25.937107329 +0100
@@ -420,7 +420,7 @@
             memset(buf, 0, sizeof(buf));
             strncpy(buf, lp, strcspn(lp, ". "));
             sscanf(buf, "%d", &stat->signal);
-            stat->signal -= 0x100;
+            if (stat->signal > 0x80) stat->signal -= 0x100;
             if (random) stat->signal = rnd_signal(-102, 10);
             avg_signal += stat->signal / (float)slotsize;
             lp += strlen(buf);
@@ -430,7 +430,7 @@
             memset(buf, 0, sizeof(buf));
             strncpy(buf, lp, strcspn(lp, ". "));
             sscanf(buf, "%d", &stat->noise);
-            stat->noise -= 0x100;
+            if (stat->noise > 0x80) stat->noise -= 0x100;
             if (random) stat->noise = rnd_noise(-102, -30);
             avg_noise += stat->noise / (float)slotsize;
             lp += strlen(buf);
openSUSE Build Service is sponsored by