Skip to content

Commit

Permalink
Address #1 Sanitize SSID for CSV
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 e8d0b49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Wardriver/src/Wardriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ 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 e8d0b49

Please sign in to comment.