Skip to content

Commit

Permalink
Fixed csv reading bug
Browse files Browse the repository at this point in the history
  • Loading branch information
n0nexist authored Jan 6, 2024
1 parent b13a46a commit ed13812
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import (
"sync"
"strings"
"time"
"encoding/csv"

"github.com/akamensky/argparse"
)

var (
version = "1.0.1"
version = "1.0.2"
author = "n0nexist"
mapEntries = []string{}
foundBssids = []string{}
Expand Down Expand Up @@ -97,7 +98,20 @@ func getIconString(device_type, auth_mode string) string{
}

func processLine(line, action, filterssid, filtermac string) {
parts := strings.Split(line, ",")
r := csv.NewReader(strings.NewReader(line))
r.Comma = ','

parts, err := r.Read()
if err != nil {
fmt.Println("Errore durante la lettura della riga:", err)
return
}

if len(parts) < 9 {
fmt.Println("La riga non contiene abbastanza campi")
return
}

mac := parts[0]
ssid := parts[1]
auth_mode := parts[2]
Expand Down

0 comments on commit ed13812

Please sign in to comment.