mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-03 00:31:36 +08:00
Fix buffer full test in generic CAN driver (plus fixes to comments)
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4259 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
+1
-1
@@ -326,7 +326,7 @@ static ssize_t can_read(FAR struct file *filep, FAR char *buffer, size_t buflen)
|
||||
FAR struct can_msg_s *msg = &dev->cd_recv.cf_buffer[dev->cd_recv.cf_head];
|
||||
int msglen = CAN_MSGLEN(msg->cm_hdr);
|
||||
|
||||
if (ret + msglen > buflen)
|
||||
if (nread + msglen > buflen)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user