diff options
| author | Steve Markgraf <steve@steve-m.de> | 2019-08-25 17:31:09 +0200 |
|---|---|---|
| committer | Steve Markgraf <steve@steve-m.de> | 2019-08-25 17:31:09 +0200 |
| commit | 6c21e9d01f8169643de76a0342a1f49a52212cfc (patch) | |
| tree | 5c9a6228b25e9ba9d5daab5261b7f4f115c81cc8 | |
| parent | d56968352c626dda51552bb469ac23a8964d6d29 (diff) | |
| download | osmo-fl2k-6c21e9d01f8169643de76a0342a1f49a52212cfc.tar.gz osmo-fl2k-6c21e9d01f8169643de76a0342a1f49a52212cfc.tar.bz2 osmo-fl2k-6c21e9d01f8169643de76a0342a1f49a52212cfc.zip | |
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.
| -rw-r--r-- | src/fl2k_file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fl2k_file.c b/src/fl2k_file.c index cff5178..80ddcad 100644 --- a/src/fl2k_file.c +++ b/src/fl2k_file.c @@ -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); |
