fix edge-case where bytes_to_read is equal to length of bytes read
rtlsdr_callback would never set do_exit if the length of data read was exactly equal to the remaining bytes_to_read: the first if-block would fail the bytes_to_read < len, but the latter check would decrement bytes_to_read to 0, which would then never subsequently trigger the first block.
This commit is contained in:
parent
8ad23ce933
commit
86898f16dd
1 changed files with 1 additions and 1 deletions
|
@ -605,7 +605,7 @@ static void rtlsdr_callback(unsigned char *iq_buf, uint32_t len, void *ctx) {
|
|||
if (do_exit || do_exit_async)
|
||||
return;
|
||||
|
||||
if ((bytes_to_read > 0) && (bytes_to_read < len)) {
|
||||
if ((bytes_to_read > 0) && (bytes_to_read <= len)) {
|
||||
len = bytes_to_read;
|
||||
do_exit = 1;
|
||||
rtlsdr_cancel_async(dev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue