From 07e541678ca8c55c39780f7960c559a3e9c7ee1e Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 17 Nov 2022 15:04:20 +0100 Subject: Move hex conversion helpers to util These are used here and there so let's make them more general rather than hiding them in the stream classes. --- win/rfb_win32/Win32Util.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'win/rfb_win32/Win32Util.cxx') diff --git a/win/rfb_win32/Win32Util.cxx b/win/rfb_win32/Win32Util.cxx index fc66274f..2fbce0dd 100644 --- a/win/rfb_win32/Win32Util.cxx +++ b/win/rfb_win32/Win32Util.cxx @@ -61,13 +61,13 @@ FileVersionInfo::FileVersionInfo(const TCHAR* filename) { } const TCHAR* FileVersionInfo::getVerString(const TCHAR* name, DWORD langId) { - char langIdBuf[sizeof(langId)]; + uint8_t langIdBuf[sizeof(langId)]; for (int i=sizeof(langIdBuf)-1; i>=0; i--) { - langIdBuf[i] = (char) (langId & 0xff); + langIdBuf[i] = (langId & 0xff); langId = langId >> 8; } - TCharArray langIdStr(rdr::HexOutStream::binToHexStr(langIdBuf, sizeof(langId))); + TCharArray langIdStr(binToHex(langIdBuf, sizeof(langId))); TCharArray infoName(_tcslen(_T("StringFileInfo")) + 4 + _tcslen(name) + _tcslen(langIdStr.buf)); _stprintf(infoName.buf, _T("\\StringFileInfo\\%s\\%s"), langIdStr.buf, name); -- cgit v1.2.3