From: Jo-Philipp Wich Date: Thu, 15 Mar 2018 23:42:18 +0000 (+0100) Subject: uci: use correct sort index when reordering sections X-Git-Url: http://git.openwrt.org/?p=project%2Frpcd.git;a=commitdiff_plain;h=92d0d757161d1950f11abb6e679bfdafa7cbfe85 uci: use correct sort index when reordering sections When reordering, the section indexes must be 0-based while the current implementation incorrectly numbers starting with 1. Fix this by start numbering ther sections with index 0. Signed-off-by: Jo-Philipp Wich --- diff --git a/uci.c b/uci.c index 49c2336..17b4d89 100644 --- a/uci.c +++ b/uci.c @@ -968,7 +968,7 @@ rpc_uci_order(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *cur; struct uci_package *p = NULL; struct uci_ptr ptr = { 0 }; - int rem, i = 1; + int rem, i = 0; blobmsg_parse(rpc_uci_order_policy, __RPC_O_MAX, tb, blob_data(msg), blob_len(msg));