I had a nasty typo that wasted my time and my colleague\'s time, it was something like this:
for (i = 0; i < blah; i++); // <- I had a semi-colon here, tha
I would start by learning about splint and gdb. If you need more advanced, build on these two tools. But they are a good start.