diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2015-07-07 00:17:37 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2015-07-07 00:17:37 +1200 |
commit | 2c729734692b2c6e12da83c5ab335892e1e82027 (patch) | |
tree | 226a284ce6ebd1aab0a0f09ea148417c0d4fae82 | |
parent | 9f82f60fd2c41572168dc3546a76aa53dff2029e (diff) | |
download | cue-bin-split-2c729734692b2c6e12da83c5ab335892e1e82027.tar.xz |
Last, half-filled buffer is now dumped to output too (whoops)
-rw-r--r-- | cue-bin-split.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cue-bin-split.c b/cue-bin-split.c index 644ea7d..4b47701 100644 --- a/cue-bin-split.c +++ b/cue-bin-split.c @@ -148,13 +148,16 @@ int main(int argc, char **argv) MIN(sizeof(buffer)/sample_size, (finish_sample - i)), fin); - if (feof(fin)) - break; - - if (ferror(fin)) + if (items == 0) { - perror("fread"); - break; + if (feof(fin)) + break; + + if (ferror(fin)) + { + perror("fread"); + break; + } } if (fwrite(buffer, sample_size, items, fout) != items) |