From cb2d7936d043d52734fb65cfe04eb6d9c3738b6b Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 14 Dec 2018 10:21:25 +1100 Subject: [PATCH] Fix field detection in ANSI --- app/Classes/Frame/Videotex.php | 1 + app/Classes/Parser/Ansi.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Classes/Frame/Videotex.php b/app/Classes/Frame/Videotex.php index 12978b8..ad113f8 100644 --- a/app/Classes/Frame/Videotex.php +++ b/app/Classes/Frame/Videotex.php @@ -28,6 +28,7 @@ class Videotex extends AbstractFrame $this->output .= HOME.UP.$msg.HOME; } + // @todo Change to use a Parser, like we do for ANSI public function fields($startline=1) { $infield = FALSE; // In a field diff --git a/app/Classes/Parser/Ansi.php b/app/Classes/Parser/Ansi.php index 5f1e41e..a819afb 100644 --- a/app/Classes/Parser/Ansi.php +++ b/app/Classes/Parser/Ansi.php @@ -115,7 +115,7 @@ class Ansi extends AbstractParser { $c--; // Allow for the original ESC $advance++; $fieldtype = ord($nextbyte)%128; // @todo Do we need the %128 for ANSI? - $fieldlength = $this->findEOF(chr($fieldtype),$c+1)+1; + $fieldlength = $this->findEOF(chr($fieldtype),$c+2)+1; $byte = '';