WiFi: clean up AP SSID setter & getter, support 32 chars by mcspr · Pull Request #7941 · esp8266/Arduino

@mcspr I am facing a problem where Calling WiFi.softAP(SSIDS.c_str(), PASSS.c_str()); Isnt working, and not updating the ssid and password.
It is only taking for the first time, next time if i upload code with different SSID and PASS, it is not updated(The wifi discovered by phone is still have the same older name). I even tried this pr, but still the same.

Is it a related problem ?
Sketch

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>


String SSIDS = "NewSSID"; // If next time i change this and upload the code again, ssid displayed doesnt actually change. 
String PASSS = "NewPassword";


/* Just a little test message.  Go to http://192.168.4.1 in a web browser
   connected to this access point to see it.
*/


void setup() {
  delay(1000);
  Serial.begin(115200);
  Serial.println();
  Serial.print("Configuring access point...");
  /* You can remove the password parameter if you want the AP to be open. */
  WiFi.softAP(SSIDS.c_str(), PASSS.c_str());

  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
 
}

void loop() {
  server.handleClient();
}

This is misbehaving when the new password is different.
Example -
Next time keep

String SSIDS = "ArihnatNK"; 
String PASSS = "Generic";

In that case the ssid will not be updated,

Also, calling WiFi.softAP(SSIDS.c_str()); without password is leading to continous crash due to exception.