Merge pull request #1008 from jansramek/master

Fix getting of possible channels (darwin) #998
This commit is contained in:
Simone Margaritelli 2023-07-25 14:35:25 +02:00 committed by GitHub
commit ee35550f70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,7 +41,8 @@ func getFrequenciesFromChannels(output string) ([]int, error) {
if output != "" {
if matches := WiFiChannelParser.FindStringSubmatch(output); len(matches) == 2 {
for _, channel := range str.Comma(matches[1]) {
if channel, err := strconv.Atoi(channel); err == nil {
re := regexp.MustCompile(`\d+`)
if channel, err := strconv.Atoi(re.FindString(channel)); err == nil {
freqs = append(freqs, Dot11Chan2Freq(channel))
}
}