diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-04 20:49:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-01-04 20:49:47 +0000 |
commit | 99a753f17a5f82ae34fbbbc564757bb99666afbd (patch) | |
tree | e5ab1ef913b7324c1e05d2a6a7a37171f24e2af5 /nuttx/drivers/can.c | |
parent | 10b9a1fa0c8d68bb7f2c6fac7176669052831401 (diff) | |
download | px4-nuttx-99a753f17a5f82ae34fbbbc564757bb99666afbd.tar.gz px4-nuttx-99a753f17a5f82ae34fbbbc564757bb99666afbd.tar.bz2 px4-nuttx-99a753f17a5f82ae34fbbbc564757bb99666afbd.zip |
Fix buffer full test in generic CAN driver (plus fixes to comments)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4259 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/can.c')
-rw-r--r-- | nuttx/drivers/can.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nuttx/drivers/can.c b/nuttx/drivers/can.c index 41c3548ea..40c179e1c 100644 --- a/nuttx/drivers/can.c +++ b/nuttx/drivers/can.c @@ -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; } |