Revert to original loop

Original loop was correct, and slightly more efficient. Retain
initialization of ret to handle the case where passed in count is 0.
This commit is contained in:
Jean Cyr
2014-07-26 09:05:44 -04:00
parent 2de38d0628
commit 3a4da7c5fa
+1 -2
View File
@@ -274,12 +274,11 @@ int
PX4IO_Uploader::recv_bytes(uint8_t *p, unsigned count)
{
int ret = OK;
while (count) {
while (count--) {
ret = recv_byte_with_timeout(p++, 5000);
if (ret != OK)
break;
count--;
}
return ret;
}