Skip to content

Commit

Permalink
fixed invalid buffer size when copying to PrintStream
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Apr 14, 2018
1 parent 0728c6d commit 27c99e1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jansi/src/main/java/org/fusesource/jansi/AnsiMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ private static void printJansiLogoDemo() throws IOException {
Reader in = new InputStreamReader(AnsiMain.class.getResourceAsStream("jansi.txt"), "UTF-8");
try {
char[] buf = new char[1024];
while (in.read(buf) >= 0) {
System.out.print(buf);
int l = 0;
while ((l = in.read(buf)) >= 0) {
for(int i = 0; i < l; i++) {
System.out.print(buf[i]);
}
}
} finally {
closeQuietly(in);
Expand Down

0 comments on commit 27c99e1

Please sign in to comment.