commit f878ec275d289883ec792702c085e3b885e54dcc
parent 9ec50c910b6b42c5256f4b6dc3d49152602bbeb6
Author: Denis Kenzior <denkenz@gmail.com>
Date: Thu, 17 Oct 2019 18:00:33 -0500
scan: Fix logic error in frequency validation
The intent here was to validate that the frequency is a multiple of 5
and lies in a certain range. Somehow the channel was checked for being
a multiple of 5 instead.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/scan.c b/src/scan.c
@@ -1523,7 +1523,7 @@ uint8_t scan_freq_to_channel(uint32_t freq, enum scan_band *out_band)
}
if (freq >= 5005 && freq < 5900) {
- if (channel % 5)
+ if (freq % 5)
return 0;
channel = (freq - 5000) / 5;
@@ -1535,7 +1535,7 @@ uint8_t scan_freq_to_channel(uint32_t freq, enum scan_band *out_band)
}
if (freq >= 4905 && freq < 5000) {
- if (channel % 5)
+ if (freq % 5)
return 0;
channel = (freq - 4000) / 5;