summaryrefslogtreecommitdiff
path: root/src/udev/libudev-util-private.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2012-04-04 05:18:14 +0200
committerKay Sievers <kay.sievers@vrfy.org>2012-04-04 05:21:35 +0200
commitfc863deadaf07da24f3593fca6c6e09b62cd772c (patch)
tree27ffd57657a907fb49f965e27521c803aabae65a /src/udev/libudev-util-private.c
parent3e2147858f21943d5f4a781c60f33ac22c6096ed (diff)
udev: fix gcc warnings
Diffstat (limited to 'src/udev/libudev-util-private.c')
-rw-r--r--src/udev/libudev-util-private.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/libudev-util-private.c b/src/udev/libudev-util-private.c
index 08f0ba2228..f764ab4d8b 100644
--- a/src/udev/libudev-util-private.c
+++ b/src/udev/libudev-util-private.c
@@ -116,11 +116,11 @@ int util_delete_path(struct udev *udev, const char *path)
uid_t util_lookup_user(struct udev *udev, const char *user)
{
char *endptr;
- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
- char buf[buflen];
struct passwd pwbuf;
struct passwd *pw;
uid_t uid;
+ size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ char *buf = alloca(buflen);
if (strcmp(user, "root") == 0)
return 0;
@@ -141,11 +141,11 @@ uid_t util_lookup_user(struct udev *udev, const char *user)
gid_t util_lookup_group(struct udev *udev, const char *group)
{
char *endptr;
- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
- char *buf;
struct group grbuf;
struct group *gr;
gid_t gid = 0;
+ size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
+ char *buf = alloca(buflen);
if (strcmp(group, "root") == 0)
return 0;