From 7e99a0b0a9ed685dece6457a92c87c86daa69bfc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 30 Jun 2008 02:43:27 +0000 Subject: 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 --- src/inputPlugins/_ogg_common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/inputPlugins/_ogg_common.c b/src/inputPlugins/_ogg_common.c index 3ec227a66..b0a9900a6 100644 --- a/src/inputPlugins/_ogg_common.c +++ b/src/inputPlugins/_ogg_common.c @@ -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 -- cgit v1.2.3