未验证 提交 c6a5a2a3 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #1314 from enkiller/dev

[drivers]Fix put_force bug
......@@ -119,8 +119,11 @@ rt_size_t rt_ringbuffer_put_force(struct rt_ringbuffer *rb,
space_length = rt_ringbuffer_space_len(rb);
if (length > space_length)
if (length > rb->buffer_size)
{
ptr = &ptr[length - rb->buffer_size];
length = rb->buffer_size;
}
if (rb->buffer_size - rb->write_index > length)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册