Skip to content

Commit

Permalink
fixed length checks (copy/paste error)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhund committed Oct 2, 2024
1 parent 4f46d85 commit 8b12fcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ public int read(char[] cbuf, int off, int len) throws IOException
{
String line = generateLine();

if (len != TASK_ROW_LINE_LENGTH)
throw new IllegalArgumentException("Buffer length " + TASK_ROW_LINE_LENGTH + " expected");
if (line.length() != TASK_ROW_LINE_LENGTH)
throw new IllegalArgumentException("Line length " + TASK_ROW_LINE_LENGTH + " expected");

System.arraycopy(line.toCharArray(), 0, cbuf, 0, TASK_ROW_LINE_LENGTH);
currentTask++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ public int read(char[] cbuf, int off, int len) throws IOException
{
String line = generateLine();

if (len != TASK_ROW_LINE_LENGTH)
throw new IllegalArgumentException("Buffer length " + TASK_ROW_LINE_LENGTH + " expected");
if (line.length() != TASK_ROW_LINE_LENGTH)
throw new IllegalArgumentException("Line length " + TASK_ROW_LINE_LENGTH + " expected");

System.arraycopy(line.toCharArray(), 0, cbuf, 0, TASK_ROW_LINE_LENGTH);
currentTask++;
Expand Down

0 comments on commit 8b12fcb

Please sign in to comment.