Fixed off by one error: could call memcpy() with '0' as size argument.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12910 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-05-31 01:17:25 +00:00
parent d1407b9d2b
commit dde78a340e

View File

@ -93,7 +93,7 @@ write_to_buffer(struct ring_buffer *buffer, const uint8 *data, ssize_t length,
ssize_t bytesWritten = length;
int32 position = buffer->first + buffer->in;
if (position + length < buffer->size) {
if (position + length <= buffer->size) {
// simple copy
if (user) {
if (user_memcpy(buffer->buffer + position, data, length) < B_OK)