d/hdk: handle 0 bytes read

This commit is contained in:
Christoph Haag 2023-01-26 00:23:18 +01:00
parent bc1d355e26
commit e7fff3e435

View file

@ -135,6 +135,9 @@ hdk_device_update(struct hdk_device *hd)
}
hd->quat_valid = false;
return 0;
} else if (bytesRead == 0) {
HDK_WARN(hd, "Read 0 bytes from device");
return 1;
}
while (bytesRead > 0) {
if (bytesRead != MSG_LEN_LARGE && bytesRead != MSG_LEN_SMALL) {