Skip to content

Commit

Permalink
#1 Sanitize SSID for CSV output
Browse files Browse the repository at this point in the history
Wrapped SSID in double quotes to handle potential special characters.
- Escaped internal double quotes in SSID for CSV compliance.
- Ensured CSV formatting remains consistent even if SSID contains
disruptive characters.
  • Loading branch information
lukeswitz committed Aug 8, 2023
1 parent 88a5b8a commit cf8e53c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Wardriver/src/Wardriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void scanNets() {
if (WiFi.encryptionType(i) == WIFI_AUTH_OPEN) openNets++;
#endif

sprintf(entry,"%s,%s,%s,%s,%u,%i,%f,%f,%i,%f,WIFI", WiFi.BSSIDstr(i).c_str(), WiFi.SSID(i).c_str(),authType,strDateTime,WiFi.channel(i),WiFi.RSSI(i),lat,lng,alt,hdop);
sprintf(entry, "%s,\"%s\",%s,%s,%u,%i,%f,%f,%i,%f,WIFI", WiFi.BSSIDstr(i).c_str(), WiFi.SSID(i).c_str(), authType, strDateTime, WiFi.channel(i), WiFi.RSSI(i), lat, lng, alt, hdop);
Serial.println(entry);
Filesys::write(entry);
}
Expand Down

0 comments on commit cf8e53c

Please sign in to comment.