Skip to content

Commit

Permalink
[libs] Fix SerialClass available() return value (libretiny-eu#173)
Browse files Browse the repository at this point in the history
Co-authored-by: descipher <[email protected]>
  • Loading branch information
descipher and GelidusResearch authored Sep 21, 2023
1 parent 5a4b932 commit 3b79636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/common/arduino/libraries/api/Serial/Serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 3b79636

Please sign in to comment.