bugfix: local buffer was not set to 0 at initialization
This commit is contained in:
@ -46,7 +46,7 @@ init(const void* s, long minsize)
|
||||
else
|
||||
{
|
||||
// clear local buffer
|
||||
memset(buffer+minsize, 0, cap-minsize);
|
||||
memset(buffer, 0, cap);
|
||||
}
|
||||
if (s) {
|
||||
len = minsize;
|
||||
@ -54,6 +54,13 @@ init(const void* s, long minsize)
|
||||
}
|
||||
}
|
||||
|
||||
// How the buffer looks like:
|
||||
// |----free-----|####used####|-------free-------|
|
||||
///|<--- offs -->|<-- len --->|<- cap-offs-len ->|
|
||||
// 0 offs offs+len cap
|
||||
// |<-------------- minsize --------------->
|
||||
|
||||
|
||||
void StreamBuffer::
|
||||
grow(long minsize)
|
||||
{
|
||||
|
Reference in New Issue
Block a user