Projucer obfuscated-string-code assertion


#1

Projucer --obfuscated-string-code "a string"

leads to a JUCE Assertion failure in juce_Random.cpp:87
this can be fixed in getStringConcatenationExpression() :

-    int breakPos = jlimit (1, length - 1, (length / 3) + rng.nextInt (length / 3));
+    int breakPos = length < 3 ? 1 : jlimit (1, length - 1, (length / 3) + rng.nextInt (length / 3));

#2

Thanks, I’ll get that sorted out.


#3

Whilst you’re there, perhaps you could fix this bug too?

$ Projucer --obfuscated-string-code "It's a string"
String createString()
{
    String s0;  s0 << 'I';
    String s1;  s1 << 't' << ''' << 's' << ' ' << 'a';
    String s2;  s2 << ' ';
    String s3;  s3 << 's' << 't' << 'r' << 'i' << 'n' << 'g';

    String result = (s0 + (s1 + (s2 + s3)));

    jassert (result == "It's a string");
    return result;
}

''' should in fact be '\''


#4

Yep will do, thanks.