X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=gui_common.c;h=07cab16fe211c740c7a25a484e1fee5271490498;hp=2c499126e11ce3fcca637acc13259c909f199e05;hb=633f7c0f0194cd8ec3a478d820f55dd6a752d915;hpb=2ed89c59f0efcd0a2763f47c7d3455663241e623 diff --git a/gui_common.c b/gui_common.c index 2c499126..07cab16f 100644 --- a/gui_common.c +++ b/gui_common.c @@ -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; }