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

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

@tobias-loew

Description

@tobias-loew

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions