summaryrefslogtreecommitdiff
path: root/src/udev/libudev-queue.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-queue.c
parent3e2147858f21943d5f4a781c60f33ac22c6096ed (diff)
udev: fix gcc warnings
Diffstat (limited to 'src/udev/libudev-queue.c')
-rw-r--r--src/udev/libudev-queue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/udev/libudev-queue.c b/src/udev/libudev-queue.c
index 0e82cb6ae8..48184ddaa6 100644
--- a/src/udev/libudev-queue.c
+++ b/src/udev/libudev-queue.c
@@ -171,7 +171,7 @@ ssize_t udev_queue_skip_devpath(FILE *queue_file)
unsigned short int len;
if (fread(&len, sizeof(unsigned short int), 1, queue_file) == 1) {
- char devpath[len];
+ char *devpath = alloca(len);
/* use fread to skip, fseek might drop buffered data */
if (fread(devpath, 1, len, queue_file) == len)
@@ -197,7 +197,7 @@ ssize_t udev_queue_read_devpath(FILE *queue_file, char *devpath, size_t size)
/* if devpath was too long, skip unread characters */
if (read_bytes != len) {
unsigned short int skip_bytes = len - read_bytes;
- char buf[skip_bytes];
+ char *buf = alloca(skip_bytes);
if (fread(buf, 1, skip_bytes, queue_file) != skip_bytes)
return -1;