Slightly reworked the final write loop.
[ruby-vorbistagger.git] / ext / vcedit.c
index 70eae0591af0e91ac5dee35e9858fb3aaa7e80cf..75bf80db99aac4b3205172cb5c14b520b4d9193a 100644 (file)
@@ -512,7 +512,7 @@ vcedit_write (vcedit_state *state)
        /* clear it, because not all paths to here do */
        state->eosin = 0;
 
-       while (!state->eosin) { /* We reached eos, not eof */
+       do {
                /* We copy the rest of the stream (other logical streams)
                 * through, a page at a time.
                 */
@@ -537,7 +537,7 @@ vcedit_write (vcedit_state *state)
                ogg_sync_wrote (&state->oy, bytes);
 
                state->eosin = !bytes && feof (state->in);
-       }
+       } while (!state->eosin);
 
        fclose (out);
        fclose (state->in);