solution to yesterday’s problem

March 3rd, 2004 at 1:06 pm

Usually the freakiest problems have the simplest solutions…

The mistake was indeed caused by ^M, but not in the code (so it’s not the fault of C macros like assert()) but in one of my data files (a text file with test cases).

It’s the same problem I had with ESMS last week: when the last token on some line is numeric and is parsed with strtoul() or strtod(), a ^M screws up the parsing.

What happened in my code is that the parsing function correctly threw an exception, but in the place where it was caught I forgot to continue to the next test case, so an illegal object was passed on, which caused the assertion.

No related posts.

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)