Browse Source

More print build warnings fixes

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.1-rc1
falkTX 6 years ago
parent
commit
80cf43bec5
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      source/plugin/carla-vst.cpp

+ 7
- 5
source/plugin/carla-vst.cpp View File

@@ -240,7 +240,8 @@ public:
case effGetProgramName:
if (char* const programName = (char*)ptr)
{
std::strncpy(programName, fProgramName, 24);
std::strncpy(programName, fProgramName, 23);
programName[23] = '\0';
return 1;
}
break;
@@ -248,7 +249,8 @@ public:
case effGetProgramNameIndexed:
if (char* const programName = (char*)ptr)
{
std::strncpy(programName, fProgramName, 24);
std::strncpy(programName, fProgramName, 23);
programName[23] = '\0';
return 1;
}
break;
@@ -298,15 +300,15 @@ public:
std::snprintf(cptr, 23, "%d%s%s",
static_cast<int>(paramValue),
param->unit != nullptr && param->unit[0] != '\0' ? " " : "",
param->unit != nullptr ? param->unit : "");
param->unit != nullptr && param->unit[0] != '\0' ? param->unit : "");
cptr[23] = '\0';
}
else
{
std::snprintf(cptr, 23, "%f%s%s",
std::snprintf(cptr, 23, "%.12g%s%s",
static_cast<double>(paramValue),
param->unit != nullptr && param->unit[0] != '\0' ? " " : "",
param->unit != nullptr ? param->unit : "");
param->unit != nullptr && param->unit[0] != '\0' ? param->unit : "");
cptr[23] = '\0';
}



Loading…
Cancel
Save