diff options
Diffstat (limited to 'src/grp-udev/collect/collect.c')
-rw-r--r-- | src/grp-udev/collect/collect.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/grp-udev/collect/collect.c b/src/grp-udev/collect/collect.c index 8ce6176184..f1e326820f 100644 --- a/src/grp-udev/collect/collect.c +++ b/src/grp-udev/collect/collect.c @@ -85,16 +85,16 @@ static void usage(void) */ static int prepare(char *dir, char *filename) { - char buf[512]; + char buf[PATH_MAX]; int r, fd; r = mkdir(dir, 0700); if (r < 0 && errno != EEXIST) return -errno; - xsprintf(buf, "%s/%s", dir, filename); + snprintf(buf, sizeof buf, "%s/%s", dir, filename); - fd = open(buf,O_RDWR|O_CREAT|O_CLOEXEC, S_IRUSR|S_IWUSR); + fd = open(buf, O_RDWR|O_CREAT|O_CLOEXEC, S_IRUSR|S_IWUSR); if (fd < 0) fprintf(stderr, "Cannot open %s: %m\n", buf); |