summaryrefslogtreecommitdiff
path: root/src/udev/collect/collect.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-11-02 22:44:36 -0600
committerGitHub <noreply@github.com>2016-11-02 22:44:36 -0600
commitb23f2b72bfad53e4420ac661d1771801fc2003f3 (patch)
tree288e2a20228ce10d387737c84bd74e6d2989e027 /src/udev/collect/collect.c
parent7fa6328cc447a4a834ebc8d68ae6c335f4c9c9d3 (diff)
parente02c6135602bef7de81d7736d5c0959d45d5085c (diff)
Merge pull request #4546 from keszybz/xsprintf-revert
xsprintf revert
Diffstat (limited to 'src/udev/collect/collect.c')
-rw-r--r--src/udev/collect/collect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
index 349585b634..0e973cd521 100644
--- a/src/udev/collect/collect.c
+++ b/src/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);