From 3b79636d00b6773bf5e9ebda92ecb1fb81c07f36 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Thu, 21 Sep 2023 10:19:51 -0500 Subject: [PATCH] [libs] Fix SerialClass available() return value (#173) Co-authored-by: descipher <120155735+GelidusResearch@users.noreply.github.com> --- cores/common/arduino/libraries/api/Serial/Serial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/common/arduino/libraries/api/Serial/Serial.cpp b/cores/common/arduino/libraries/api/Serial/Serial.cpp index 509d3539b..d9a3cb46d 100644 --- a/cores/common/arduino/libraries/api/Serial/Serial.cpp +++ b/cores/common/arduino/libraries/api/Serial/Serial.cpp @@ -24,7 +24,7 @@ void SerialClass::adrParse(uint8_t c) { #endif int SerialClass::available() { - return this->buf && this->buf->available(); + return this->buf ? this->buf->available() : 0; } int SerialClass::peek() {