Added NULL checks at the start of all functions and fixed documentation.
Removed finished TODO - adding NULL checks.
Removed unnecessary assigments of \0 where they already were.
Removed finished TODO - removing unnecessary \0s.
Moved assigments of length after CHECK_NULL.

Reason being that you need to check first if source or destination are NULL before checking for any values inside them.
Removed finished TODO - moving assigments after checks.