|
@@ -2203,7 +2203,7 @@ std::string MidiInWinMM :: getPortName( unsigned int portNumber )
|
|
|
|
|
|
#if defined( UNICODE ) || defined( _UNICODE )
|
|
|
int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1;
|
|
|
- stringName.resize( --length );
|
|
|
+ stringName.assign( length, 0 );
|
|
|
length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast<int>(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL);
|
|
|
#else
|
|
|
stringName = std::string( deviceCaps.szPname );
|
|
@@ -2277,7 +2277,7 @@ std::string MidiOutWinMM :: getPortName( unsigned int portNumber )
|
|
|
|
|
|
#if defined( UNICODE ) || defined( _UNICODE )
|
|
|
int length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, -1, NULL, 0, NULL, NULL) - 1;
|
|
|
- stringName.resize( --length );
|
|
|
+ stringName.assign( length, 0 );
|
|
|
length = WideCharToMultiByte(CP_UTF8, 0, deviceCaps.szPname, static_cast<int>(wcslen(deviceCaps.szPname)), &stringName[0], length, NULL, NULL);
|
|
|
#else
|
|
|
stringName = std::string( deviceCaps.szPname );
|