commit a26f5a241db42ddabf345028994373a0a5929a26
parent 5ffcbe5e0a7104f64702a832c9a696ad43adba83
Author: falkTX <falktx@gmail.com>
Date: Mon, 5 Aug 2019 14:48:02 +0100
Handle situation of addAttribute values being empty
Does not happen right now, but might in the future
Signed-off-by: falkTX <falktx@gmail.com>
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp
@@ -167,7 +167,15 @@ static void addAttribute(String& text,
const bool endInDot = false)
{
if (values[0] == nullptr)
+ {
+ if (endInDot)
+ {
+ bool found;
+ const size_t index = text.rfind(';', &found);
+ if (found) text[index] = '.';
+ }
return;
+ }
const size_t attributeLength = std::strlen(attribute);