Off by one error in nextPrintableChar. Closes #4111, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@23863 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
extempore 2010-12-31 09:12:32 +00:00
parent 37fab48e00
commit 39a76d8b8e
1 changed files with 2 additions and 1 deletions

View File

@ -94,7 +94,8 @@ class Random(val self: java.util.Random) {
* from the ASCII range 33-126.
*/
def nextPrintableChar(): Char = {
val (low, high) = (33, 126)
val low = 33
val high = 127
(self.nextInt(high - low) + low).toChar
}