mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 13:58:53 +08:00
protocol_splitter: fix type comparison
This commit is contained in:
@@ -384,7 +384,7 @@ ssize_t Mavlink2Dev::write(struct file *filp, const char *buffer, size_t buflen)
|
|||||||
int buf_free;
|
int buf_free;
|
||||||
::ioctl(_fd, FIONSPACE, (unsigned long)&buf_free);
|
::ioctl(_fd, FIONSPACE, (unsigned long)&buf_free);
|
||||||
|
|
||||||
if (buf_free < buflen) {
|
if (buf_free < (int)buflen) {
|
||||||
//let write fail, to let mavlink know the buffer would overflow
|
//let write fail, to let mavlink know the buffer would overflow
|
||||||
//(this is because in the ioctl we pretend there is always enough space)
|
//(this is because in the ioctl we pretend there is always enough space)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
@@ -617,4 +617,3 @@ out:
|
|||||||
PX4_ERR("unrecognized command, try 'start <device>', 'stop', 'status'");
|
PX4_ERR("unrecognized command, try 'start <device>', 'stop', 'status'");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user