1. fgets(3) reads at most 1 less then the size argument. 2. Each line of /proc/filesystem isn't a filesystem path. So it doesn't really matter if the size argument is PATH_MAX-1 or PATH_MAX (=sizeof(buf)) as long as the buffer is large enough. We can just use sizeof(buf). Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@xxxxxxxxx> --- daemon/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/module.c b/daemon/module.c index bed8f7a..6cf7b7b 100644 --- a/daemon/module.c +++ b/daemon/module.c @@ -38,7 +38,7 @@ int load_autofs4_module(void) return 0; } - while (fgets(buf, PATH_MAX - 1, fp)) { + while (fgets(buf, sizeof(buf), fp)) { if (strstr(buf, "autofs")) { fclose(fp); return 1; -- 2.5.5 -- To unsubscribe from this list: send the line "unsubscribe autofs" in