Skip to content

Commit aac1119

Browse files
authored
Remove unnecessary -1 in substring call
Substring goes from `beginIndex` to `endIndex - 1`. Having the `- 1` in the code here makes the resulting string be of size 11, but should be size 12.
1 parent f87b7b8 commit aac1119

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/botdetector/ui/BotDetectorPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ private void predictPlayer()
10351035
{
10361036
searchBar.setIcon(IconTextField.Icon.ERROR);
10371037
searchBarLoading = false;
1038-
setPredictionError(target.substring(0, MAX_RSN_LENGTH - 1) + "...",
1038+
setPredictionError(target.substring(0, MAX_RSN_LENGTH) + "...",
10391039
"Name Input Error",
10401040
"Name cannot be longer than " + MAX_RSN_LENGTH + " characters");
10411041
return;

0 commit comments

Comments
 (0)