summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/doas/doas.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c
index 0c16f17efc5..70456d725b2 100644
--- a/usr.bin/doas/doas.c
+++ b/usr.bin/doas/doas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doas.c,v 1.28 2015/07/27 15:38:11 espie Exp $ */
+/* $OpenBSD: doas.c,v 1.29 2015/07/28 14:08:52 zhuk Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -256,8 +256,10 @@ copyenv(const char **oldenvp, struct rule *rule)
size_t j;
for (j = 0; j < nextras; j++) {
if (strcmp(extra[j], safeset[i]) == 0) {
- extra[j--] = extra[nextras--];
+ nextras--;
+ extra[j] = extra[nextras];
extra[nextras] = NULL;
+ j--;
}
}
}