mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
iob: iob_clone_partial support Negative offset
make the function can correctly handle negative offset cases Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
+1
-1
@@ -140,7 +140,7 @@ int iob_clone_partial(FAR struct iob_s *iob1, unsigned int len,
|
||||
while (iob2 != NULL)
|
||||
{
|
||||
avail2 = CONFIG_IOB_BUFSIZE - iob2->io_offset;
|
||||
if (offset2 < avail2)
|
||||
if ((int)(offset2 - avail2) < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user