From 7233131b3787a6fc326e959629c1b8f4109ea40f Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 29 Jan 2013 01:20:04 +0900 Subject: Check the data returned by read or docmd aren't null first. --- libvxi11client/perlbits/Client.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvxi11client/perlbits/Client.pm b/libvxi11client/perlbits/Client.pm index df58e34..f4c76a4 100644 --- a/libvxi11client/perlbits/Client.pm +++ b/libvxi11client/perlbits/Client.pm @@ -68,7 +68,7 @@ sub vxi_read { my ($bytes, $string, $reason) = vxi_read_long($self, $args{bufferlen}, $args{waitlock}, $args{termchrset},$args{termchr}); - if ($args{autochomp}) { + if (defined($string) && $args{autochomp}) { chomp ($string); } @@ -89,7 +89,7 @@ sub vxi_docmd { my ($ret, $dataout, $dataoutlen) = vxi_docmd_long($self, $args{datain}, $args{datainlen}, $args{dataoutbufferlen}, $args{waitlock}); - if ($args{autochomp}) { + if (defined($dataout) && $args{autochomp}) { chomp ($dataout); } -- cgit