diff --git a/router_result.c b/router_result.c index 8a03723..27760b1 100644 --- a/router_result.c +++ b/router_result.c @@ -144,11 +144,15 @@ static bool check_plan_invariants (plan_t *plan) { for (i_leg = 0; i_leg < itin->n_legs; ++i_leg) { leg_t *leg = itin->legs + i_leg; if (i_leg % 2 == 0) { - if (leg->journey_pattern != WALK) fprintf(stderr, "even numbered leg %d has journey_pattern %d not WALK.\n", i_leg, leg->journey_pattern); - fail = true; + if (leg->journey_pattern != WALK) { + fprintf(stderr, "even numbered leg %d has journey_pattern %d not WALK.\n", i_leg, leg->journey_pattern); + fail = true; + } } else { - if (leg->journey_pattern == WALK) fprintf(stderr, "odd numbered leg %d has journey_pattern WALK.\n", i_leg); - fail = true; + if (leg->journey_pattern == WALK) { + fprintf(stderr, "odd numbered leg %d has journey_pattern WALK.\n", i_leg); + fail = true; + } } if (leg->t1 < leg->t0) { fprintf(stderr, "non-increasing times within leg %d: %d, %d\n", i_leg, leg->t0, leg->t1); @@ -316,7 +320,7 @@ bool router_result_to_plan (plan_t *plan, router_t *router, router_request_t *re plan->n_itineraries += 1; itin += 1; } - return check_plan_invariants (plan); + return !check_plan_invariants (plan); } /* After routing, call to convert the router state into a readable list of