mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-05 03:50:07 +00:00
Projucer: Avoid hitting an assertion in Random::nextInt() when using the --obfuscated-string-code command-line tool with strings containing fewer than 3 sections
This commit is contained in:
parent
55bc08f3cd
commit
97922ff129
1 changed files with 1 additions and 1 deletions
|
|
@ -519,7 +519,7 @@ namespace
|
|||
if (length == 1)
|
||||
return "s" + String (start);
|
||||
|
||||
int breakPos = jlimit (1, length - 1, (length / 3) + rng.nextInt (length / 3));
|
||||
int breakPos = jlimit (1, length - 1, (length / 3) + rng.nextInt (jmax (1, length / 3)));
|
||||
|
||||
return "(" + getStringConcatenationExpression (rng, start, breakPos)
|
||||
+ " + " + getStringConcatenationExpression (rng, start + breakPos, length - breakPos) + ")";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue