Skip to content

Commit

Permalink
handle zero bit-count max-digits properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Foley committed Jan 28, 2024
1 parent a3cc341 commit 4b1b5c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Binary file modified IPAddress/dist/IPAddress.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ protected static int getMaxDigitCount(int radix, int bitCount, long maxValue) {
}

private static int getDigitCount(int bitCount, int radix) {
if(bitCount < 0) {
if(bitCount <= 0) {
if(bitCount == 0 && radix >= MIN_RADIX && radix <= MAX_RADIX) {
return 1;
}
throw new IllegalArgumentException();
}
switch(radix) {
Expand Down

0 comments on commit 4b1b5c4

Please sign in to comment.