Future-proof available() check to handle negative return values

This commit is contained in:
J. Nick Koston
2026-02-09 04:35:11 -06:00
parent 33c831dbb8
commit a0f736b7aa
+3 -1
View File
@@ -397,8 +397,10 @@ bool Nextion::remove_from_q_(bool report_empty) {
}
void Nextion::process_serial_() {
// All current UART available() implementations return >= 0,
// use <= 0 to future-proof against any that may return negative on error.
int avail = this->available();
if (avail == 0) {
if (avail <= 0) {
return;
}