From a6ecf6c9920b689ad125b00fed3fd3923f62283c Mon Sep 17 00:00:00 2001 From: Max Kellermann <max@musicpd.org> Date: Thu, 14 Mar 2019 13:57:21 +0100 Subject: [PATCH] test/run_filter: move the buffer into the loop --- test/run_filter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/run_filter.cxx b/test/run_filter.cxx index 31452f440..b5f16be01 100644 --- a/test/run_filter.cxx +++ b/test/run_filter.cxx @@ -61,8 +61,6 @@ LoadFilter(const ConfigData &config, const char *name) int main(int argc, char **argv) try { - char buffer[4096]; - if (argc < 3 || argc > 4) { fprintf(stderr, "Usage: run_filter CONFIG NAME [FORMAT] <IN\n"); return EXIT_FAILURE; @@ -97,6 +95,8 @@ try { /* play */ while (true) { + char buffer[4096]; + ssize_t nbytes; nbytes = read(0, buffer, sizeof(buffer));