Browse Source

Fix a few compiler warnings

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.10
falkTX 3 months ago
parent
commit
61459c8b4b
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      source/backend/engine/CarlaEngineOscSend.cpp
  2. +2
    -1
      source/utils/CarlaString.hpp

+ 1
- 1
source/backend/engine/CarlaEngineOscSend.cpp View File

@@ -216,7 +216,7 @@ void CarlaEngineOsc::sendPluginProgramCount(const CarlaPluginPtr& plugin) const
CARLA_SAFE_ASSERT_RETURN(plugin != nullptr,); CARLA_SAFE_ASSERT_RETURN(plugin != nullptr,);
carla_stdout("CarlaEngineOsc::sendPluginDataCount(%p)", plugin.get()); carla_stdout("CarlaEngineOsc::sendPluginDataCount(%p)", plugin.get());


char targetPath[std::strlen(fControlDataTCP.path)+7];
char targetPath[std::strlen(fControlDataTCP.path)+8];
std::strcpy(targetPath, fControlDataTCP.path); std::strcpy(targetPath, fControlDataTCP.path);
std::strcat(targetPath, "/pcount"); std::strcat(targetPath, "/pcount");
try_lo_send(fControlDataTCP.target, targetPath, "iii", try_lo_send(fControlDataTCP.target, targetPath, "iii",


+ 2
- 1
source/utils/CarlaString.hpp View File

@@ -788,13 +788,14 @@ public:
} }


// we have some data ourselves, reallocate to add the new stuff // we have some data ourselves, reallocate to add the new stuff
char* const newBuf = (char*)realloc(fBuffer, fBufferLen + strBufLen + 1);
char* const newBuf = (char*)realloc(fBufferAlloc ? fBuffer : nullptr, fBufferLen + strBufLen + 1);
CARLA_SAFE_ASSERT_RETURN(newBuf != nullptr, *this); CARLA_SAFE_ASSERT_RETURN(newBuf != nullptr, *this);


std::memcpy(newBuf + fBufferLen, strBuf, strBufLen + 1); std::memcpy(newBuf + fBufferLen, strBuf, strBufLen + 1);


fBuffer = newBuf; fBuffer = newBuf;
fBufferLen += strBufLen; fBufferLen += strBufLen;
fBufferAlloc = true;


return *this; return *this;
} }


Loading…
Cancel
Save