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:
Steve Markgraf 2019-08-25 17:31:09 +02:00
parent d56968352c
commit 6c21e9d01f
1 changed files with 1 additions and 1 deletions

View File

@ -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);