Skip to content

Commit 1412606

Browse files
Arsham Skrenesme-no-dev
Arsham Skrenes
authored andcommitted
Properly allocate string and remove warning (espressif#2652)
* Properly allocate string and remove warning The former way generates the following warning: ISO C++ forbids converting a string constant to 'char*' This change makes a character array the size of the string with null ending. It's clearer and gets rid of the warning. * Better way Since this is technically immutable, the type should reflect this too.
1 parent 25c0b52 commit 1412606

File tree

1 file changed

+1
-1
lines changed
  • libraries/ESP32/examples/ESPNow/Basic/Slave

1 file changed

+1
-1
lines changed

libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void InitESPNow() {
5151

5252
// config AP SSID
5353
void configDeviceAP() {
54-
char* SSID = "Slave_1";
54+
const char *SSID = "Slave_1";
5555
bool result = WiFi.softAP(SSID, "Slave_1_Password", CHANNEL, 0);
5656
if (!result) {
5757
Serial.println("AP Config failed.");

0 commit comments

Comments
 (0)