From: Andre Date: Thu, 2 Mar 2006 14:08:38 +0000 (+0100) Subject: fix off-by-one error X-Git-Tag: v0.2.11~43 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=ef1066346672b1a83a4d2146e61659984a3b97fd;p=paraslash.git fix off-by-one error Also, make "bufsize" const instead of static. --- diff --git a/gui_common.c b/gui_common.c index 2c499126..d806ebe2 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)