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
This commit is contained in:
Max Kellermann 2008-06-30 02:43:27 +00:00 committed by Eric Wong
parent 06bdc5bf25
commit 7e99a0b0a9

View File

@ -36,15 +36,14 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream)
* http://lists.xiph.org/pipermail/flac/2004-December/000393.html
* ogg123 trunk still doesn't have this patch as of June 2005 */
unsigned char buf[41];
size_t r, to_read = 41;
size_t r;
seekInputStream(inStream, 0, SEEK_SET);
while (to_read) {
r = readFromInputStream(inStream, buf, 1, to_read);
while (1) {
r = readFromInputStream(inStream, buf, 1, sizeof(buf));
if (inStream->error)
break;
to_read -= r;
if (!r && !inputStreamAtEOF(inStream))
my_usleep(10000);
else