Skip to content

Commit d449003

Browse files
Fix warning about impossible comparison condition
1 parent cb540b8 commit d449003

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/SparkFun_Qwiic_OLED.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,8 +744,8 @@ template <typename DeviceType> class QwiicOLEDBaseClass : public Print // NOTE:
744744

745745
void setCursor(uint8_t x, uint8_t y)
746746
{
747-
748-
if (x < 0 || x >= m_device.width() || y < 0 || y >= m_device.height())
747+
// Note: x < 0 and y < 0 are also illegal but are not possible with uint8_t arguments
748+
if (x >= m_device.width() || y >= m_device.height())
749749
return;
750750

751751
m_cursorX = x;

0 commit comments

Comments
 (0)