summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/acpid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index 7dd4f5b..3429309 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -74,6 +74,7 @@ int acpid_main(int argc, char **argv)
}
argv += optind;
+ argc -= optind;
// goto configuration directory
xchdir(opt_conf);
@@ -102,7 +103,7 @@ int acpid_main(int argc, char **argv)
// evdev files given, use evdev interface
// open event devices
- pfd = xzalloc(sizeof(*pfd) * (argc - optind));
+ pfd = xzalloc(sizeof(*pfd) * argc);
nfd = 0;
while (*argv) {
pfd[nfd].fd = open_or_warn(*argv++, O_RDONLY | O_NONBLOCK);