diff options
Diffstat (limited to 'include/salticidae/stream.h')
-rw-r--r-- | include/salticidae/stream.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/salticidae/stream.h b/include/salticidae/stream.h index 03b9d13..267d294 100644 --- a/include/salticidae/stream.h +++ b/include/salticidae/stream.h @@ -109,11 +109,11 @@ class DataStream { const uint8_t *get_data_inplace(size_t len) { auto res = (uint8_t *)&*(buffer.begin() + offset); + offset += len; #ifndef SALTICIDAE_NOCHECK - if (offset + len > buffer.size()) + if (offset > buffer.size()) throw std::ios_base::failure("insufficient buffer"); #endif - offset += len; return res; } |