Skip to content

Commit

Permalink
Fixes stray 0 in compiled code as reported in smarty-php/smarty#822
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid committed Oct 24, 2022
1 parent 73b6eea commit e0ee273
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ParserGenerator/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1034,15 +1034,15 @@ private function tplt_xfer($name, $in, $out, &$lineno)
*/
private function tplt_linedir($out, $lineno, $filename)
{
fwrite($out, '// line ' . $lineno . ' "' . $filename . "\"\n");
fwrite($out, '// line ' . intval($lineno) . ' "' . $filename . "\"\n");
}

/**
* Print a string to the file and keep the linenumber up to date
*/
private function tplt_print($out, $str, $strln, &$lineno)
{
if ($str == '') {
if ($str == '' || $str == 0) {
return;
}
$this->tplt_linedir($out, $strln, $this->filename);
Expand Down

0 comments on commit e0ee273

Please sign in to comment.