summaryrefslogtreecommitdiff
path: root/libvxi11client/perlbits/Client.pm
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-29 01:20:04 +0900
committerdaniel <danieruru@gmail.com>2013-01-29 01:20:04 +0900
commit7233131b3787a6fc326e959629c1b8f4109ea40f (patch)
tree14ea6222d03ab0ba25e5dbeb7af0694ab15af337 /libvxi11client/perlbits/Client.pm
parent34edd87cbc6f35d8f199e726dd00a4aa763dcbff (diff)
Check the data returned by read or docmd aren't null first.
Diffstat (limited to 'libvxi11client/perlbits/Client.pm')
-rw-r--r--libvxi11client/perlbits/Client.pm4
1 files 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);
}