osmo-config-merge: Don't use C99 'for' loop initial declarations

The existing code passed gerrit build verification but failed the master
builds with the following error:

osmo-config-merge.c:148:4: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
    for (int i = 0; i < cur_indent - indent; i++) {
    ^
osmo-config-merge.c:148:4: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your
code

Change-Id: Ia29e85b648c1a427be88242306634efe890e250d
This commit is contained in:
Harald Welte 2018-09-25 22:51:20 +02:00
parent 0d67f483e2
commit eda6fe42a5
1 changed files with 4 additions and 2 deletions

View File

@ -145,7 +145,8 @@ static struct node *file_read(void *ctx, const char *fname)
/* new child to last node */
n = node_alloc_child(last);
} else if (indent < cur_indent) {
for (int i = 0; i < cur_indent - indent; i++) {
int i;
for (i = 0; i < cur_indent - indent; i++) {
/* go to parent, add another sibling */
if (last->parent)
last = last->parent;
@ -202,7 +203,8 @@ static void dump_node(struct node *root, FILE *out, bool print_node_depth)
if (root->line) {
if (print_node_depth) {
for (int i = 0; i < level; i++)
int i;
for (i = 0; i < level; i++)
fputc('*', out);
}