- Always make sure that the parameters that are passed to a function and the variables that are dealing with the parameters are always of the same type (including qualifiers) (get an unsigned long and add all of them in a signed long)
- Initialize the dynamically allocated structures. They contain a lot of crap.
- When using library functions make sure you know the behavior of the function and that the parameters being passed are appropriate. (using strncmp for comparing hex strings – a stupid thing to do)
- Don’t have presumptions about the code – that some part is correct and some is not. It becomes difficult to debug them.