bitcoin/bitcoin — pull request #4940 by laanwj (2014-09-18 08:17:42+00:00)
Title: CMessageHeader sanity changes

- Remove spurious `pchCommand[1] = 1` in CMessageHeader()
- Make sure that pchCommand is zero-padded if length is shorter than COMMAND_SIZE
- Use strnlen to determine length of pchCommand in GetCommand

I'm afraid that pulltester's old mingw will complain about lack of strncpy. This is not actually a problem with more recent compilers on windows: I verified that it works fine with gitian's version, and it should work with Travis.