diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-07-31 09:52:00 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-07-31 09:52:00 +1000 |
| commit | a5022ac6cb64ef68210b8204591b1deb84ea70d8 (patch) | |
| tree | 534a9a9d38020e12ba4c5ff485e94236b33443e6 /src/database | |
| parent | 485eed28903a0bc23df9c1ced1417e35fd58c43c (diff) | |
| download | tangara-fw-a5022ac6cb64ef68210b8204591b1deb84ea70d8.tar.gz | |
fix bsd-ish callback behaviour
Diffstat (limited to 'src/database')
| -rw-r--r-- | src/database/tag_parser.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/database/tag_parser.cpp b/src/database/tag_parser.cpp index f7e1ceec..3d3df7e8 100644 --- a/src/database/tag_parser.cpp +++ b/src/database/tag_parser.cpp @@ -43,6 +43,9 @@ struct Aux { static int read(Tagctx* ctx, void* buf, int cnt) { Aux* aux = reinterpret_cast<Aux*>(ctx->aux); + if (f_eof(&aux->file)) { + return 0; + } UINT bytes_read; if (f_read(&aux->file, buf, cnt, &bytes_read) != FR_OK) { return -1; @@ -65,7 +68,10 @@ static int seek(Tagctx* ctx, int offset, int whence) { } else { return -1; } - return res; + if (res != FR_OK) { + return -1; + } + return aux->file.fptr; } static void tag(Tagctx* ctx, |
