no need to copy the 'length' variable
remove unnecessary null pointer check
single newline after main to comply with C99
0.0.4