-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
In files anf.c and anr.c at line 111 the following appears:
if (nev < nel)
if((a->lidx += a->lincr) > a->lidx_max) a->lidx = a->lidx_max;
else
if((a->lidx -= a->ldecr) < a->lidx_min) a->lidx = a->lidx_min;
But the C compiler interprets this as:
if (nev < nel) {
if((a->lidx += a->lincr) > a->lidx_max)
a->lidx = a->lidx_max;
else if((a->lidx -= a->ldecr) < a->lidx_min)
a->lidx = a->lidx_min;
}
That is, the "else" goes with the nearest "if". If the indenting is correct, we must add curly braces. If the logic is correct we must change the indentation and again add curly braces for clarity.
Which is correct, the indenting or the logic?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels