Skip to content
Browse files

Trim the newline left by fgets

parseLine breaks up the incoming string, and the last component is a
number that contains a newline character. A warning is generated each
time that the variable is involved in math operations

Trim the newline left by fgets after the read counter is incremented to
eliminate those warnings.
  • Loading branch information...
Stantheman authored and derickr committed Jul 31, 2018
1 parent e9dda01 commit 6f0b683ea16947ad1bc78e1aab29e435539516cc
Showing with 1 addition and 0 deletions.
  1. +1 −0 contrib/tracefile-analyser.php
@@ -132,6 +132,7 @@ public function parse()
$buffer = fgets( $this->handle, 4096 );
$read += strlen( $buffer );
$buffer = rtrim( $buffer, PHP_EOL );
$this->parseLine( $buffer );

0 comments on commit 6f0b683

Please sign in to comment.
You can’t perform that action at this time.