aboutsummaryrefslogtreecommitdiff
path: root/tools/EventClients
diff options
context:
space:
mode:
Diffstat (limited to 'tools/EventClients')
-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)