mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-27 13:25:13 +00:00
* Fix: RegionMap build fail on _max
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
|
||||
class BufStream : public Stream {
|
||||
public:
|
||||
BufStream(char *buf, size_t max)
|
||||
: _buf(buf), _max(max), _pos(0) {
|
||||
if (_max > 0) _buf[0] = 0;
|
||||
BufStream(char *buf, size_t max_len)
|
||||
: _buf(buf), _max_len(max_len), _pos(0) {
|
||||
if (_max_len > 0) _buf[0] = 0;
|
||||
}
|
||||
|
||||
size_t write(uint8_t c) override {
|
||||
if (_pos + 1 >= _max) return 0;
|
||||
if (_pos + 1 >= _max_len) return 0;
|
||||
_buf[_pos++] = c;
|
||||
_buf[_pos] = 0;
|
||||
return 1;
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
|
||||
private:
|
||||
char *_buf;
|
||||
size_t _max;
|
||||
size_t _max_len;
|
||||
size_t _pos;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user