X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fzone.c;fp=src%2Fzone.c;h=385e5116af87b67b1bc67761dad82718d2859e1b;hp=e4aad81513bb2b9858139d3990e31de924f6b73f;hb=4ecc24f84bc88eca1f358e604fceea3ef71683ff;hpb=1d2d244077bd02f5ab7b53aef27f8d6e343f8a4a 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);