From 024c8fc1991a4f5e51fadf35c20e92ba1e9c0631 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 31 Jul 2022 10:41:27 +0200 Subject: [PATCH] repair peek --- RingStream.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RingStream.h b/RingStream.h index 8b183aa..cfc82eb 100644 --- a/RingStream.h +++ b/RingStream.h @@ -48,7 +48,8 @@ class RingStream : public Print { void flush(); void info(); byte readRawByte(); - inline byte peek() { + inline int peek() { + if ((_pos_read==_pos_write) && !_overflow) return -1; // empty return _buffer[_pos_read]; }; private: