Fix a bug in the output of para_audioc.
authorAndre Noll <maan@systemlinux.org>
Sun, 5 Jul 2009 08:40:55 +0000 (10:40 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 5 Jul 2009 08:40:55 +0000 (10:40 +0200)
This bites In case of short writes to stdout. The bug was literally there since day one
but never showed up as short writes usually don't happen with the rather small amount
of data that is written by para_audioc.

audioc.c

index 666990d..5c081da 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -151,6 +151,8 @@ int main(int argc, char *argv[])
                                goto out;
                        }
                        loaded -= ret;
+                       if (loaded && ret)
+                               memmove(buf, buf + ret, loaded);
                }
        }
 out: