1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-24 11:38:00 +01:00

Do not hardcode the char[] length in StringUtils

This commit is contained in:
Florian Schmaus 2014-07-07 00:03:11 +02:00
parent 8b16c49a31
commit e469601468

View file

@ -261,7 +261,7 @@ public class StringUtils {
// Create a char buffer to put random letters and numbers in.
char [] randBuffer = new char[length];
for (int i=0; i<randBuffer.length; i++) {
randBuffer[i] = numbersAndLetters[randGen.nextInt(71)];
randBuffer[i] = numbersAndLetters[randGen.nextInt(numbersAndLetters.length)];
}
return new String(randBuffer);
}