SVN trunk.
Look at functions:
storageForPlugins::GetDataFileUnicode()
and
storageForPlugins::GetDataFileAnsi()
These casts just can't be correct:
line 259:
textRealSize = MultiByteToWideChar(m_codepage, flags, pchar, nchars, (WCHAR*)((char*)fileDataOut.pMapBase+bom_bytes), textForeseenSize-1)* sizeof(WCHAR);
Line 482:
pwchar = (WCHAR*) ((char*)fileDataIn.pMapBase+2); // pass the BOM
What the heck somebody thought when he wrote those casts?
Anyway, seems that whole file needs careful review and cleanup. Maybe few bugs get fixed while doing it..
Logged In: YES
user_id=954028
Originator: NO
Do you mean like the code below?
Line 482:
pwchar = (WCHAR*)fileDataIn.pMapBase+1; // pass the BOM
Logged In: YES
user_id=631874
Originator: YES
Yes, that is already a lot easier to understand. I'm don't know why there are those (char *) casts in original code. And I'm afraid they cause some wrong results also, like pointing to wrong byte in WCHAR type.