Skip to content
This repository

Logic errors in mk_cheby.c introduced by commit r631 #185

Open
griffithJ opened this Issue September 14, 2012 · 0 comments

1 participant

griffithJ
griffithJ

In r631, in four places in mk_cheby.c, the single statement in a "for" loop was split into two statements, but no curly braces were added. As a result the second half is only executed once after the loop exits, not for every iteration as the original code did. For example:

                                for (i = 0; i < nru; ++i) /* store coefficient rows for u */
-                                       if (Ts->cu[i].m = ncu[i])
+                                       Ts->cu[i].m = ncu[i];
+                                       if (Ts->cu[i].m)
                                                if ((p = Ts->cu[i].c =
                                                                (double *)pj_malloc(sizeof(double) * ncu[i])))
                                                        for (j = 0; j < ncu[i]; ++j)

Xcode 4.4 and later complains about dangling "else" statements so adding the missing curly braces fixes that warning as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.