fl2k_file: check read return value before repeating
In case of a FIFO that has been closed or a 0 byte file this will otherwise lead to an endless loop.
This commit is contained in:
parent
d56968352c
commit
6c21e9d01f
|
@ -95,7 +95,7 @@ void fl2k_callback(fl2k_data_info_t *data_info)
|
|||
fprintf(stderr, "File Error\n");
|
||||
|
||||
if (feof(file)) {
|
||||
if (repeat) {
|
||||
if (repeat && (r > 0)) {
|
||||
repeat_cnt++;
|
||||
fprintf(stderr, "repeat %d\n", repeat_cnt);
|
||||
rewind(file);
|
||||
|
|
Loading…
Reference in New Issue