[libzomg] Metadata_win32.cpp: Remove trailing NULL bytes from the username.
authorDavid Korth <gerbilsoft@gerbilsoft.com>
Sun, 6 Sep 2015 19:13:43 +0000 (15:13 -0400)
committerDavid Korth <gerbilsoft@gerbilsoft.com>
Sun, 6 Sep 2015 19:13:43 +0000 (15:13 -0400)
commitdd22830ae304d1b82d8f5d5e6ad04d899b922bf0
tree20727ce2f43de70500e693687b8cfecaffc1bcb5
parent184757e7eed5ce93ce31edb06bba4aa9303ba61c
[libzomg] Metadata_win32.cpp: Remove trailing NULL bytes from the username.

GetUserName() and GetUserNameEx() return NULL-terminated strings.
We shouldn't include the NULL terminator; otherwise, C stdio will
stop printing the string data once it encounters the NULL.

This broke the PrintMetadata test on Windows 98SE, since fputs()
stopped printing text once it reached the NULL byte in the username.

Sidenote: While GetUserNameEx() returns a NULL-terminated string,
lpnSize doesn't include the NULL terminator. This is why it worked
correctly on Windows XP, but not Windows 98SE.
src/libzomg/Metadata_win32.cpp