diff options
author | spiff <spiff@xbmc.org> | 2010-12-30 20:38:18 +0100 |
---|---|---|
committer | spiff <spiff@xbmc.org> | 2011-01-04 20:37:47 +0100 |
commit | fbfbb65333490d555fe229e8cad29bf6f6f6a799 (patch) | |
tree | 1e6ac550d2c5cd60dd0b343a151278f2ca7495a7 /tools/EventClients | |
parent | 809ba68ae563e01d234896279d80063083d1e53b (diff) |
fixed: wrong buffer size and mismatching new[]/free usage. part of ticket #10929
Diffstat (limited to 'tools/EventClients')
-rw-r--r-- | tools/EventClients/Clients/WiiRemote/CWIID_WiiRemote.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/EventClients/Clients/WiiRemote/CWIID_WiiRemote.cpp b/tools/EventClients/Clients/WiiRemote/CWIID_WiiRemote.cpp index 5fc42f1054..c609b9cfb0 100644 --- a/tools/EventClients/Clients/WiiRemote/CWIID_WiiRemote.cpp +++ b/tools/EventClients/Clients/WiiRemote/CWIID_WiiRemote.cpp @@ -183,14 +183,11 @@ void CWiiRemote::SetJoystickMap(const char *JoyMap) free(m_JoyMap); if (JoyMap != NULL) { - m_JoyMap = new char[strlen(JoyMap) + 4]; + m_JoyMap = (char*)malloc(strlen(JoyMap) + 5); sprintf(m_JoyMap, "JS0:%s", JoyMap); } else - { - m_JoyMap = new char[strlen("JS0:WiiRemote")]; - strcpy(m_JoyMap, "JS0:WiiRemote"); - } + m_JoyMap = strdup("JS0:WiiRemote"); } void CWiiRemote::Initialize(CAddress Addr, int Socket) |