Browse Source

Avoid gcc >= 8 warning about possible string truncation when using std::strncpy

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
pull/77/head
Christopher Arndt Filipe Coelho <falktx@falktx.com> 5 years ago
parent
commit
ba1ec818e8
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      distrho/src/DistrhoPluginVST.cpp

+ 1
- 1
distrho/src/DistrhoPluginVST.cpp View File

@@ -71,7 +71,7 @@ static const writeMidiFunc writeMidiCallback = nullptr;

void strncpy(char* const dst, const char* const src, const size_t size)
{
std::strncpy(dst, src, size-1);
std::memcpy(dst, src, std::min(std::strlen(src), size-1));
dst[size-1] = '\0';
}



Loading…
Cancel
Save