From: Alan T. DeKok Date: Fri, 28 Jul 2017 13:33:43 +0000 (-0400) Subject: increment 'i' when we use it, not at the end of the loop X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04d6ebcbb68fa0e5d94140be622ebd6988f6ec44;p=thirdparty%2Ffreeradius-server.git increment 'i' when we use it, not at the end of the loop which means if we 'continue' after running a callback, it will still increment 'i' --- diff --git a/src/main/cf_parse.c b/src/main/cf_parse.c index 6e76665fe29..13fc14b073c 100644 --- a/src/main/cf_parse.c +++ b/src/main/cf_parse.c @@ -958,7 +958,7 @@ static int cf_subsection_parse(TALLOC_CTX *ctx, void *out, CONF_SECTION *cs, CON if (array) { MEM(buff = talloc_zero_array(array, uint8_t, subcs_size)); if (rule->subcs_type) talloc_set_name_const(buff, rule->subcs_type); - array[i] = buff; + array[i++] = buff; } /* @@ -983,8 +983,6 @@ static int cf_subsection_parse(TALLOC_CTX *ctx, void *out, CONF_SECTION *cs, CON talloc_free(array); return ret; } - - i++; } if (out) *((uint8_t ***)out) = array;