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.
This commit is contained in:
parent
793934cf9c
commit
0dc1b4a44e
@ -55,7 +55,8 @@ static GByteArray *mod_loadfile(struct decoder *decoder, struct input_stream *is
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = g_malloc(MODPLUG_READ_BLOCK);
|
data = g_malloc(MODPLUG_READ_BLOCK);
|
||||||
do {
|
|
||||||
|
while (true) {
|
||||||
ret = decoder_read(decoder, is, data, MODPLUG_READ_BLOCK);
|
ret = decoder_read(decoder, is, data, MODPLUG_READ_BLOCK);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
if (input_stream_eof(is))
|
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);
|
g_byte_array_append(bdatas, data, ret);
|
||||||
} while (input_stream_eof(is));
|
}
|
||||||
|
|
||||||
g_free(data);
|
g_free(data);
|
||||||
|
|
||||||
return bdatas;
|
return bdatas;
|
||||||
|
Loading…
Reference in New Issue
Block a user