From 306f91b322419c803ffae6774a1302823a1c7747 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sat, 19 Nov 2022 12:50:11 +0000 Subject: [PATCH] Memory Issues --- RingStream.cpp | 5 ----- StringBuffer.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/RingStream.cpp b/RingStream.cpp index 9db6230..c63ebf7 100644 --- a/RingStream.cpp +++ b/RingStream.cpp @@ -189,11 +189,6 @@ bool RingStream::commit() { _mark++; if (_mark==_len) _mark=0; _buffer[_mark]=lowByte(_count); - { char s[_count+2]; - strncpy(s, (const char*)&(_buffer[_mark+1]), _count); - s[_count]=0; - //DIAG(F("RS commit count=%d core %d \"%s\""), _count, xPortGetCoreID(), s); - } _ringClient = NO_CLIENT; return true; // commit worked } diff --git a/StringBuffer.h b/StringBuffer.h index fe227fb..ac42964 100644 --- a/StringBuffer.h +++ b/StringBuffer.h @@ -32,7 +32,7 @@ class StringBuffer : public Print { private: static const int buffer_max=64; // enough for long text msgs to throttles int16_t _pos_write; - char _buffer[buffer_max+1]; + char _buffer[buffer_max+2]; }; #endif \ No newline at end of file