General Care Always check return values of system calls an library functions - make this test exhaustive. In any global function that accepts parameters - check for their sanity (pointers to data must not be NULL, data should not be out of range). If a function might fail - have it return some error code to its caller. Don't just ignore the possibility of failure. When an inner function fails - it should return an error string to its caller - not just try to display it to the user. Exception: the function can overcome the error and hide it from the calling function. The function then may ignore the error, or issue a warning to the user, depending on context.