Browse Source

Projucer: Avoid hitting an assertion in Random::nextInt() when using the --obfuscated-string-code command-line tool with strings containing fewer than 3 sections

tags/2021-05-28
ed 6 years ago
parent
commit
97922ff129
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      extras/Projucer/Source/Application/jucer_CommandLine.cpp

+ 1
- 1
extras/Projucer/Source/Application/jucer_CommandLine.cpp View File

@@ -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…
Cancel
Save