From 4ecc24f84bc88eca1f358e604fceea3ef71683ff Mon Sep 17 00:00:00 2001 From: Dagobert Michelsen Date: Thu, 28 May 2015 13:22:29 +0200 Subject: [PATCH] Use sizeof() instead of duplicating the variable length --- src/zone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zone.c b/src/zone.c index e4aad815..385e5116 100644 --- a/src/zone.c +++ b/src/zone.c @@ -64,7 +64,7 @@ zone_read_procfile(char *pidstr, char *file, void *buf, size_t bufsize) int fd; char procfile[MAX_PROCFS_PATH]; - (void)snprintf(procfile, MAX_PROCFS_PATH, "/proc/%s/%s", pidstr, file); + (void)snprintf(procfile, sizeof(procfile), "/proc/%s/%s", pidstr, file); while ((fd = open(procfile, O_RDONLY)) == -1) { if ((errno != EMFILE) || (errno != ENFILE)) { return(1); -- 2.30.2