aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorspiff <spiff@xbmc.org>2010-12-30 20:38:18 +0100
committerspiff <spiff@xbmc.org>2011-01-04 20:37:47 +0100
commitfbfbb65333490d555fe229e8cad29bf6f6f6a799 (patch)
tree1e6ac550d2c5cd60dd0b343a151278f2ca7495a7 /tools
parent809ba68ae563e01d234896279d80063083d1e53b (diff)
fixed: wrong buffer size and mismatching new[]/free usage. part of ticket #10929
Diffstat (limited to 'tools')
-rw-r--r--tools/EventClients/Clients/WiiRemote/CWIID_WiiRemote.cpp7
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)