Fix arithmetic on pointer warning.
Fix comparison between signed and unsigned warning.
Make a function static (no previous prototype).
Make filenames variables "const".