From 40627ffc533a65fd7967623d6071a4bcc0e471cc Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Fri, 10 Apr 2009 00:02:29 +0200 Subject: [PATCH] RemoteVstPlugin: fix issues with uniqueID Removed the newline character at the end of the uniqueID array, decreased array size to 5 and initialize last element with 0 after sprintf() call. (cherry picked from commit 7d1a357076d8da4ba8b477aa9f9c9f0940dec714) --- plugins/vst_base/remote_vst_plugin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/vst_base/remote_vst_plugin.cpp b/plugins/vst_base/remote_vst_plugin.cpp index 30a17ecbd..5f34e7288 100644 --- a/plugins/vst_base/remote_vst_plugin.cpp +++ b/plugins/vst_base/remote_vst_plugin.cpp @@ -502,8 +502,7 @@ void remoteVstPlugin::initEditor( void ) bool remoteVstPlugin::load( const std::string & _plugin_file ) { - if( ( m_libInst = LoadLibrary( _plugin_file.c_str() ) ) == - NULL ) + if( ( m_libInst = LoadLibrary( _plugin_file.c_str() ) ) == NULL ) { return false; } @@ -551,11 +550,12 @@ bool remoteVstPlugin::load( const std::string & _plugin_file ) } - char id[8]; - sprintf( id, "%c%c%c%c\n", ((char *)&m_plugin->uniqueID)[3], + char id[5]; + sprintf( id, "%c%c%c%c", ((char *)&m_plugin->uniqueID)[3], ((char *)&m_plugin->uniqueID)[2], ((char *)&m_plugin->uniqueID)[1], ((char *)&m_plugin->uniqueID)[0] ); + id[4] = 0; sendMessage( message( IdVstPluginUniqueID ).addString( id ) ); // switch to appropriate threading model