2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

long buffer correct

git-svn-id: https://svn.fhem.de/fhem/trunk@1303 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
wherzig 2012-02-28 13:56:49 +00:00
parent 0f0294290f
commit 64ebe63c2c

View File

@ -297,7 +297,7 @@ TRX_Read($)
#Log 1, "TRX: TRX_Read '$hexline'"; #Log 1, "TRX: TRX_Read '$hexline'";
# first char as byte represents number of bytes of the message # first char as byte represents number of bytes of the message
my $num_bytes = ord($TRX_data); my $num_bytes = ord(substr($TRX_data,0,1));
while(length($TRX_data) > $num_bytes) { while(length($TRX_data) > $num_bytes) {
# the buffer contains at least the number of bytes we need # the buffer contains at least the number of bytes we need
@ -310,6 +310,7 @@ TRX_Read($)
#Log 1, "TRX_Read TRX_data '$hexline'"; #Log 1, "TRX_Read TRX_data '$hexline'";
# #
TRX_Parse($hash, $hash, $name, unpack('H*', $rmsg)); TRX_Parse($hash, $hash, $name, unpack('H*', $rmsg));
$num_bytes = ord(substr($TRX_data,0,1));
} }
#Log 1, "TRX_Read END"; #Log 1, "TRX_Read END";