diff options
author | Max Kellermann <max@duempel.org> | 2009-12-15 09:08:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-12-15 09:08:30 +0100 |
commit | 243c96304b02f57f29b5e8d217a55fed752a5cb7 (patch) | |
tree | b17000cfb690e009b1e61573b5859ff932ab9383 /src/archive/bz2_plugin.c | |
parent | e3597e648cf94bbd6e12799c0c374185b3c7b3a3 (diff) | |
download | mpd-243c96304b02f57f29b5e8d217a55fed752a5cb7.tar.gz mpd-243c96304b02f57f29b5e8d217a55fed752a5cb7.tar.xz mpd-243c96304b02f57f29b5e8d217a55fed752a5cb7.zip |
archive/bz2: bz2_fillbuffer() returns bool
Diffstat (limited to 'src/archive/bz2_plugin.c')
-rw-r--r-- | src/archive/bz2_plugin.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/archive/bz2_plugin.c b/src/archive/bz2_plugin.c index cebf995e1..20f8a427b 100644 --- a/src/archive/bz2_plugin.c +++ b/src/archive/bz2_plugin.c @@ -181,7 +181,7 @@ bz2_is_close(struct input_stream *is) is->data = NULL; } -static int +static bool bz2_fillbuffer(bz2_context *context, size_t numBytes) { size_t count; @@ -190,14 +190,15 @@ bz2_fillbuffer(bz2_context *context, size_t numBytes) bzstream = &context->bzstream; if (bzstream->avail_in > 0) - return 0; + return true; count = input_stream_read(&context->istream, context->buffer, BZ_BUFSIZE); if (count == 0) { if (bzstream->avail_out == numBytes) - return -1; + return false; + if (!input_stream_eof(&context->istream)) context->last_parent_result = 1; } else { @@ -205,7 +206,7 @@ bz2_fillbuffer(bz2_context *context, size_t numBytes) bzstream->avail_in = count; } - return 0; + return true; } static size_t @@ -227,7 +228,7 @@ bz2_is_read(struct input_stream *is, void *ptr, size_t size) bzstream->avail_out = numBytes; while (bzstream->avail_out != 0) { - if (bz2_fillbuffer(context, numBytes) != 0) + if (!bz2_fillbuffer(context, numBytes)) break; bz_result = BZ2_bzDecompress(bzstream); |