aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-06-30 02:43:27 +0000
committerEric Wong <normalperson@yhbt.net>2008-06-30 02:43:27 +0000
commit7e99a0b0a9ed685dece6457a92c87c86daa69bfc (patch)
treee1adaa5550c3b22f5507d0f08da2507c2338ce29 /src
parent06bdc5bf258dae4afd640ed4d1d6e4e7ed47ad7c (diff)
downloadmpd-7e99a0b0a9ed685dece6457a92c87c86daa69bfc.tar.gz
mpd-7e99a0b0a9ed685dece6457a92c87c86daa69bfc.tar.xz
mpd-7e99a0b0a9ed685dece6457a92c87c86daa69bfc.zip
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
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/_ogg_common.c7
1 files 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