Skip to content

Commit

Permalink
refine conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess committed Jul 17, 2022
1 parent 773ad5e commit 5726713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static void skipPadding( LittleEndianByteArrayInputStream lei ) {
for (int i=0; i<skipBytes; i++) {
lei.mark(1);
int b = lei.read();
if (b == -1 || b != 0) {
if (b != 0) {
lei.reset();
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ private void setRepeatingRowsAndColumns(
if (rowDef != null) {
row1 = rowDef.getFirstRow();
row2 = rowDef.getLastRow();
if ((row1 == -1 && row2 != -1) || (row1 > row2)
if ((row1 > row2)
|| (row1 < 0 || row1 > maxRowIndex)
|| (row2 < 0 || row2 > maxRowIndex)) {
throw new IllegalArgumentException("Invalid row range specification");
Expand All @@ -2561,7 +2561,7 @@ private void setRepeatingRowsAndColumns(
if (colDef != null) {
col1 = colDef.getFirstColumn();
col2 = colDef.getLastColumn();
if ((col1 == -1 && col2 != -1) || (col1 > col2)
if ((col1 > col2)
|| (col1 < 0 || col1 > maxColIndex)
|| (col2 < 0 || col2 > maxColIndex)) {
throw new IllegalArgumentException("Invalid column range specification");
Expand Down

0 comments on commit 5726713

Please sign in to comment.