diff --git a/src/sigar_util.c b/src/sigar_util.c index 3c668fc6..325b65ad 100644 --- a/src/sigar_util.c +++ b/src/sigar_util.c @@ -838,7 +838,7 @@ int sigar_file2str(const char *fname, char *buffer, int buflen) return ENOENT; } - if ((len = read(fd, buffer, buflen)) < 0) { + if ((len = read(fd, buffer, buflen - 1)) < 0) { status = errno; } else {