We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent21640ac commitfd6ce51Copy full SHA for fd6ce51
cores/esp32/WString.cpp
@@ -180,15 +180,15 @@ bool String::changeBuffer(unsigned int maxStrLen) {
180
if (maxStrLen <sizeof(sso.buff) -1) {
181
if (isSSO() || !buffer()) {
182
// Already using SSO, nothing to do
183
-uint16_t oldLen =len();
+size_t oldLen =len();
184
setSSO(true);
185
setLen(oldLen);
186
}else {// if bufptr && !isSSO()
187
// Using bufptr, need to shrink into sso.buff
188
char temp[sizeof(sso.buff)];
189
memcpy(temp,buffer(), maxStrLen);
190
free(wbuffer());
191
192
193
memcpy(wbuffer(), temp, maxStrLen);
194
@@ -201,7 +201,7 @@ bool String::changeBuffer(unsigned int maxStrLen) {
201
if (newSize > CAPACITY_MAX) {
202
returnfalse;
203
}
204
205
char *newbuffer = (char *)realloc(isSSO() ?nullptr :wbuffer(), newSize);
206
if (newbuffer) {
207
size_t oldSize =capacity() +1;// include NULL.