mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 05:55:46 +08:00
mm/circbuf: add sanity check for resize
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -109,6 +109,10 @@ int circbuf_resize(FAR struct circbuf_s *circ, size_t bytes)
|
|||||||
|
|
||||||
DEBUGASSERT(circ);
|
DEBUGASSERT(circ);
|
||||||
DEBUGASSERT(!circ->external);
|
DEBUGASSERT(!circ->external);
|
||||||
|
if (bytes == circ->size)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (bytes)
|
if (bytes)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user