aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/run_parts.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c
index 47eda8cf6..c9b090717 100644
--- a/debianutils/run_parts.c
+++ b/debianutils/run_parts.c
@@ -42,7 +42,7 @@ struct globals {
#define cur (G.cur )
#define cmd (G.cmd )
-enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(struct globals)) / sizeof(cmd[0]) };
+enum { NUM_CMD = (COMMON_BUFSIZE - sizeof(G)) / sizeof(cmd[0]) - 1 };
enum {
OPT_r = (1 << 0),
@@ -130,9 +130,7 @@ int run_parts_main(int argc ATTRIBUTE_UNUSED, char **argv)
n = 1;
while (arg_list && n < NUM_CMD) {
- cmd[n] = arg_list->data;
- arg_list = arg_list->link;
- n++;
+ cmd[n++] = llist_pop(&arg_list);
}
/* cmd[n] = NULL; - is already zeroed out */