more audiod improvements
[paraslash.git] / gui_common.c
index 2c499126e11ce3fcca637acc13259c909f199e05..07cab16fe211c740c7a25a484e1fee5271490498 100644 (file)
@@ -13,8 +13,9 @@ int para_open_audiod_pipe(char *cmd)
 
 int read_audiod_pipe(int fd, void (*line_handler)(char *) )
 {
-       static char buf[STRINGSIZE + 1];
-       static ssize_t loaded, bufsize = sizeof(buf);
+       static char buf[STRINGSIZE];
+       const ssize_t bufsize = sizeof(buf) - 1;
+       static ssize_t loaded;
        ssize_t ret;
 
        if (loaded >= bufsize)
@@ -23,7 +24,7 @@ int read_audiod_pipe(int fd, void (*line_handler)(char *) )
        if (ret > 0) {
                loaded += ret;
                buf[loaded] = '\0';
-               loaded = for_each_line(buf, loaded, line_handler, 0);
+               loaded = for_each_line(buf, loaded, line_handler);
        }
        return ret;
 }