csyonghe / Spire

Other
174 stars 22 forks source link

Crash in x64 version inside `MByteToWideChar` #3

Closed tangent-vector closed 8 years ago

tangent-vector commented 8 years ago

It looks like the problem is that you are declaring and int:

int bufferSize;

and then passing a pointer to it where a size_t* is expected:

mbstowcs_s((size_t*)&bufferSize, ...);

This pattern is repeated for the variable pos later in the same function.

Changing both of these to size_t seems to eliminate the crash for me, but leaves me wondering whether I should be trying to use Spire in a 64-bit project...

csyonghe commented 8 years ago

This is solved. Spire is supposed to run on 64 bit platform. The bug was introduced during a port to Ubuntu.