]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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:54:19 +0000 (10:54 +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 666990dba411e65b4dfff4d4d227332e7401ac92..5c081da5d7ab94437f042e2eac80233c8bd09aa2 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: