From 14126060a135cc35e3795301fc001fc086e3ac83 Mon Sep 17 00:00:00 2001 From: Arsham Skrenes Date: Fri, 12 Apr 2019 04:46:08 -0600 Subject: [PATCH] Properly allocate string and remove warning (#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. --- libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino b/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino index 4ed8d52f..d9029e96 100644 --- a/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino +++ b/libraries/ESP32/examples/ESPNow/Basic/Slave/Slave.ino @@ -51,7 +51,7 @@ void InitESPNow() { // config AP SSID void configDeviceAP() { - char* SSID = "Slave_1"; + const char *SSID = "Slave_1"; bool result = WiFi.softAP(SSID, "Slave_1_Password", CHANNEL, 0); if (!result) { Serial.println("AP Config failed.");