]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
fix off-by-one error
authorAndre <maan@p133.(none)>
Thu, 2 Mar 2006 14:08:38 +0000 (15:08 +0100)
committerAndre <maan@p133.(none)>
Thu, 2 Mar 2006 14:08:38 +0000 (15:08 +0100)
Also, make "bufsize" const instead of static.

gui_common.c

index 2c499126e11ce3fcca637acc13259c909f199e05..d806ebe2df2b6e741ce80837fc59e3c28acb9536 100644 (file)
@@ -13,8 +13,9 @@ int para_open_audiod_pipe(char *cmd)
 
 int read_audiod_pipe(int fd, void (*line_handler)(char *) )
 {
 
 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)
        ssize_t ret;
 
        if (loaded >= bufsize)