aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-24 20:02:06 +0100
committerMax Kellermann <max@duempel.org>2009-01-24 20:02:06 +0100
commit0dc1b4a44ede7316867e3803af1444a6190d7aad (patch)
treefbd163f0cc57443fa046bf0ebdf24f401e35d045
parent793934cf9c5d79365ca5c93ab05c8c2668d0ce7d (diff)
downloadmpd-0dc1b4a44ede7316867e3803af1444a6190d7aad.tar.gz
mpd-0dc1b4a44ede7316867e3803af1444a6190d7aad.tar.xz
mpd-0dc1b4a44ede7316867e3803af1444a6190d7aad.zip
modplug: removed EOF check from the while loop
EOF is checked by input_stream_read() (decoder_read() here). Don't do it twice. The check was wrong anyway, it was reversed.
-rw-r--r--src/decoder/modplug_plugin.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/decoder/modplug_plugin.c b/src/decoder/modplug_plugin.c
index 2c097836c..e0a1d2544 100644
--- a/src/decoder/modplug_plugin.c
+++ b/src/decoder/modplug_plugin.c
@@ -55,7 +55,8 @@ static GByteArray *mod_loadfile(struct decoder *decoder, struct input_stream *is
}
data = g_malloc(MODPLUG_READ_BLOCK);
- do {
+
+ while (true) {
ret = decoder_read(decoder, is, data, MODPLUG_READ_BLOCK);
if (ret == 0) {
if (input_stream_eof(is))
@@ -76,7 +77,8 @@ static GByteArray *mod_loadfile(struct decoder *decoder, struct input_stream *is
}
g_byte_array_append(bdatas, data, ret);
- } while (input_stream_eof(is));
+ }
+
g_free(data);
return bdatas;