Use const input buffer and fix 64bit format string on Windows