Provide a safer version of convertUTF16toUTF8

This commit is contained in:
Ben Payne 2015-01-20 17:45:31 -05:00
parent a88339c219
commit e3bbc42925
10 changed files with 31 additions and 25 deletions

View file

@ -588,7 +588,7 @@ const char* DInputDevice::getName()
{
#ifdef UNICODE
static UTF8 buf[512];
convertUTF16toUTF8(mDeviceInstance.tszInstanceName, buf, sizeof(buf));
convertUTF16toUTF8(mDeviceInstance.tszInstanceName, buf);
return (const char *)buf;
#else
return mDeviceInstance.tszInstanceName;
@ -600,7 +600,7 @@ const char* DInputDevice::getProductName()
{
#ifdef UNICODE
static UTF8 buf[512];
convertUTF16toUTF8(mDeviceInstance.tszProductName, buf, sizeof(buf));
convertUTF16toUTF8(mDeviceInstance.tszProductName, buf);
return (const char *)buf;
#else
return mDeviceInstance.tszProductName;