summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2011-11-13 19:34:58 +0100
committerPixel <pixel@nobis-crew.org>2011-11-13 19:34:58 +0100
commite5619a3635dcec97afa2cddb0dc0344466324f6d (patch)
tree51e30657313aa33867444fbe5ae7b1dcdea4c55f /src
parent0edf1ac65db56054c80bc913a62172bbcebba321 (diff)
Fixing a few bugs with Buffer - yes, it indeed does need a few more unit tests....
Diffstat (limited to 'src')
-rw-r--r--src/Buffer.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Buffer.cc b/src/Buffer.cc
index e029df5..f276ec0 100644
--- a/src/Buffer.cc
+++ b/src/Buffer.cc
@@ -38,12 +38,16 @@ ssize_t Balau::Buffer::write(const void * buf, size_t count) throw (GeneralExcep
if (endBlock > oldEndBlock) {
m_buffer = (uint8_t *) realloc(m_buffer, endBlock * s_blockSize);
memset(m_buffer + oldEndBlock * s_blockSize, 0, (endBlock - oldEndBlock) * s_blockSize);
+ m_numBlocks = endBlock;
}
memcpy(m_buffer + cursor, buf, count);
wseek(cursor + count);
+ if (m_bufSize < end)
+ m_bufSize = end;
+
return count;
}