Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

CSummInfo::IncrRevNum fails in UNICODE builds (file summinfo.cpp) #12

Open
tobias-loew opened this issue Oct 26, 2018 · 0 comments
Open
Labels

Comments

@tobias-loew
Copy link

In Unicode builds of CSummInfo::IncrRevNum() the update TCHAR (which is wchar_t for Unicde) buffer gets written as type VT_LPSTR, which always expects a char*

BOOL CSummInfo::IncrRevNum() { ULONG count; _stscanf_s((LPCTSTR)GetRevNum(), _T("%lu"), &count); count++; TCHAR buff[20]; _stprintf_s(buff, 20, _T("%lu"), count); return m_pSection->Set(PIDSI_REVNUMBER, (void*)buff, VT_LPSTR); }

this can be fixed be replacing the last line of the function by

`return m_pSection->Set(PID_REVNUMBER, (void*)tcstocs(buff), VT_LPSTR);`

NB: tcstocs is defined at the top of the summinfo.cpp

@colin-home colin-home added the bug label Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants