aboutsummaryrefslogtreecommitdiff
path: root/include/salticidae/stream.h
diff options
context:
space:
mode:
authorDeterminant <tederminant@gmail.com>2018-07-25 01:22:05 -0400
committerDeterminant <tederminant@gmail.com>2018-07-25 01:22:05 -0400
commitcd2fc3625d09f2f3f062648ff9963414e0140e2a (patch)
tree77d6d06b5dd66dffe724be3a68cb151b973f8e26 /include/salticidae/stream.h
parent5cea500b410f8e34e3ad4aeef64fb0e88dce4126 (diff)
...
Diffstat (limited to 'include/salticidae/stream.h')
-rw-r--r--include/salticidae/stream.h4
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;
}