fix bsd-ish callback behaviour

This commit is contained in:
jacqueline
2023-07-31 09:52:00 +10:00
parent 485eed2890
commit a5022ac6cb
+7 -1
View File
@@ -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,