Commit 7e99a0b0 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

eliminated local variable "to_read"

The variable "to_read" is never modified except in the last iteration of the while loop. This means the while condition will never become false, as the body will break before that may be checked. git-svn-id: https://svn.musicpd.org/mpd/trunk@7396 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 06bdc5bf
...@@ -36,15 +36,14 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream) ...@@ -36,15 +36,14 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream)
* http://lists.xiph.org/pipermail/flac/2004-December/000393.html * http://lists.xiph.org/pipermail/flac/2004-December/000393.html
* ogg123 trunk still doesn't have this patch as of June 2005 */ * ogg123 trunk still doesn't have this patch as of June 2005 */
unsigned char buf[41]; unsigned char buf[41];
size_t r, to_read = 41; size_t r;
seekInputStream(inStream, 0, SEEK_SET); seekInputStream(inStream, 0, SEEK_SET);
while (to_read) { while (1) {
r = readFromInputStream(inStream, buf, 1, to_read); r = readFromInputStream(inStream, buf, 1, sizeof(buf));
if (inStream->error) if (inStream->error)
break; break;
to_read -= r;
if (!r && !inputStreamAtEOF(inStream)) if (!r && !inputStreamAtEOF(inStream))
my_usleep(10000); my_usleep(10000);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment