Skip to content

Commit

Permalink
Cleanup trailing null chars
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Feb 12, 2018
1 parent 49b1382 commit ffdbbb8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ public void run() {
while ((line = reader.readLine()) != null) {
int end = line.lastIndexOf(token);
if (end >= 0) {
if (end > 0)
if (end > 0) {
while (line.charAt(end - 1) == 0)
--end;
output(line.substring(0, end));
}
break;
}
output(line);
Expand Down

0 comments on commit ffdbbb8

Please sign in to comment.