Browse Source

bridge utils: do not use sprintf

Signed-off-by: falkTX <falktx@falktx.com>
pull/1775/head
falkTX 1 year ago
parent
commit
e7b077b06b
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      source/utils/CarlaBridgeUtils.cpp

+ 8
- 8
source/utils/CarlaBridgeUtils.cpp View File

@@ -64,8 +64,8 @@ BridgeAudioPool::~BridgeAudioPool() noexcept


bool BridgeAudioPool::initializeServer() noexcept bool BridgeAudioPool::initializeServer() noexcept
{ {
char tmpFileBase[64];
std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_AUDIO_POOL "XXXXXX");
char tmpFileBase[64] = {};
std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_AUDIO_POOL "XXXXXX");


const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase);
CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false);
@@ -167,8 +167,8 @@ BridgeRtClientControl::~BridgeRtClientControl() noexcept


bool BridgeRtClientControl::initializeServer() noexcept bool BridgeRtClientControl::initializeServer() noexcept
{ {
char tmpFileBase[64];
std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_RT_CLIENT "XXXXXX");
char tmpFileBase[64] = {};
std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_RT_CLIENT "XXXXXX");


const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase);
CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false);
@@ -337,8 +337,8 @@ BridgeNonRtClientControl::~BridgeNonRtClientControl() noexcept


bool BridgeNonRtClientControl::initializeServer() noexcept bool BridgeNonRtClientControl::initializeServer() noexcept
{ {
char tmpFileBase[64];
std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_CLIENT "XXXXXX");
char tmpFileBase[64] = {};
std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_CLIENT "XXXXXX");


const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase);
CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false);
@@ -477,8 +477,8 @@ BridgeNonRtServerControl::~BridgeNonRtServerControl() noexcept


bool BridgeNonRtServerControl::initializeServer() noexcept bool BridgeNonRtServerControl::initializeServer() noexcept
{ {
char tmpFileBase[64];
std::sprintf(tmpFileBase, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_SERVER "XXXXXX");
char tmpFileBase[64] = {};
std::snprintf(tmpFileBase, sizeof(tmpFileBase)-1, PLUGIN_BRIDGE_NAMEPREFIX_NON_RT_SERVER "XXXXXX");


const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase); const carla_shm_t shm2 = carla_shm_create_temp(tmpFileBase);
CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false); CARLA_SAFE_ASSERT_RETURN(carla_is_shm_valid(shm2), false);


Loading…
Cancel
Save