correct bounds checking in Print::printf to avoid corner case of len=64 (#2204)

This commit is contained in:
atanisoft 2018-12-16 08:09:26 -08:00 committed by Me No Dev
parent 25fd2d0f3b
commit 39836f12df

View File

@ -63,7 +63,7 @@ size_t Print::printf(const char *format, ...)
len = vsnprintf(temp, len+1, format, arg);
write((uint8_t*)temp, len);
va_end(arg);
if(len > 64){
if(len >= sizeof(loc_buf)){
delete[] temp;
}
return len;