Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cores/esp8266/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ bool String::reserve(unsigned int size) {
#ifdef DEBUG_ESP_PORT
static void identifyString (const String& badOne)
{
DEBUGV("[String] '%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s': ",
DEBUG_ESP_PORT.printf("[String] '%." STR(OOM_STRING_BORDER_DISPLAY) "s ... %." STR(OOM_STRING_BORDER_DISPLAY) "s': ",
badOne.c_str(),
badOne.length() > OOM_STRING_BORDER_DISPLAY? badOne.c_str() + std::max((int)badOne.length() - OOM_STRING_BORDER_DISPLAY, OOM_STRING_BORDER_DISPLAY): "");
}
Expand Down Expand Up @@ -231,14 +231,14 @@ bool String::changeBuffer(unsigned int maxStrLen) {
if (!isSSO() && capacity() >= OOM_STRING_THRESHOLD_REALLOC_WARN && maxStrLen > capacity()) {
// warn when badly re-allocating
identifyString(*this);
DEBUGV("Reallocating large String(%d -> %d bytes)\n", len(), maxStrLen);
DEBUG_ESP_PORT.printf("Reallocating large String(%d -> %d bytes)\n", len(), maxStrLen);
}
#endif
// Make sure we can fit newsize in the buffer
if (newSize > CAPACITY_MAX) {
#ifdef DEBUG_ESP_PORT
identifyString(*this);
DEBUGV("Maximum capacity reached (" STR(CAPACITY_MAX) ")\n");
DEBUG_ESP_PORT.printf("Maximum capacity reached (" STR(CAPACITY_MAX) ")\n");
#endif
return false;
}
Expand All @@ -261,7 +261,7 @@ bool String::changeBuffer(unsigned int maxStrLen) {
}
#ifdef DEBUG_ESP_PORT
identifyString(*this);
DEBUGV("OOM: %d -> %d bytes\n", isSSO() ? 0: capacity(), newSize);
DEBUG_ESP_PORT.printf("OOM: %d -> %zu bytes\n", isSSO() ? 0: capacity(), newSize);
#endif
return false;
}
Expand Down