Get rid of all warnings and errors on Windows.

This increases msvc compatibility.
This assumes that strlen(log) is always at least one smaller than sizeof(log)?