From f6a0df3f9c64e532c20ce87e4c90d2c915a13078 Mon Sep 17 00:00:00 2001 From: bjoernh <> Date: Sun, 20 Jan 2019 20:21:05 +0000 Subject: [PATCH] 14_CUL_TCM97001: Fix uninitialized value warning 14_CUL_REDIRECT: Fix uninitialized value warning git-svn-id: https://svn.fhem.de/fhem/trunk@18358 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/14_CUL_REDIRECT.pm | 6 +++++- fhem/FHEM/14_CUL_TCM97001.pm | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 83ece2ec2..d1ab3898f 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 14_CUL_TCM97001: Fix uninitialized value warning + - bugfix: 14_CUL_REDIRECT: Fix uninitialized value warning - feature: 93_DbRep: sqlCmd can handle SQL session variables, Forum:#96082 - bugfix: 98_DOIFtools: remove Log in DOIFtoolsNextTimer - bugfix: 93_DbRep: V8.9.10, fix warnings Malformed UTF-8 character during diff --git a/fhem/FHEM/14_CUL_REDIRECT.pm b/fhem/FHEM/14_CUL_REDIRECT.pm index ed1410687..dde365e1a 100755 --- a/fhem/FHEM/14_CUL_REDIRECT.pm +++ b/fhem/FHEM/14_CUL_REDIRECT.pm @@ -20,6 +20,8 @@ # Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110, USA # +# $Id$ +# ############################################## package main; @@ -189,7 +191,7 @@ sub decode_Hideki return (-1,"message is to long") if ($message_length > $length_max ); - my $hidekihex; + my $hidekihex = ""; my $idx; for ($idx=$message_start; $idx<$message_end; $idx=$idx+9) @@ -313,6 +315,8 @@ CUL_REDIRECT_Parse($$) 1; +=item summary This module redirects recived messages from CUL to submodules. +=item summary_DE Module leitet Nachrichrichten vom CUL an Submodule weiter. =pod =begin html diff --git a/fhem/FHEM/14_CUL_TCM97001.pm b/fhem/FHEM/14_CUL_TCM97001.pm index f672ce750..27778d570 100755 --- a/fhem/FHEM/14_CUL_TCM97001.pm +++ b/fhem/FHEM/14_CUL_TCM97001.pm @@ -152,7 +152,7 @@ sub checksum_W174 { my $msg = shift; Log3 "CUL_TCM97001 ", 4 , "CUL_TCM97001 W174 checksum calc for: $msg"; my @a = split("", $msg); - my $bitReverse = undef; + my $bitReverse = ""; my $x = undef; foreach $x (@a) { my $bin3=sprintf("%04b",hex($x)); @@ -177,7 +177,7 @@ sub checksum_W155 { my $msg = shift; Log3 "CUL_TCM97001 ", 5 , "CUL_TCM97001 W155 checksum calc for: $msg"; my @a = split("", $msg); - my $bitReverse = undef; + my $bitReverse = ""; my $x = undef; foreach $x (@a) { my $bin3=sprintf("%04b",hex($x)); @@ -201,7 +201,7 @@ sub checksum_W155 { sub checkCRC { my $msg = shift; my @a = split("", $msg); - my $bitReverse = undef; + my $bitReverse = ""; my $x = undef; foreach $x (@a) { my $bin3=sprintf("%04b",hex($x)); @@ -269,7 +269,7 @@ sub checkCRCKW9010 { my $msg = shift; Log3 "CUL_TCM97001", 5 , "CUL_TCM97001 checkCRCKW9010 crc calc for: $msg"; my @a = split("", $msg); - my $bitReverse = undef; + my $bitReverse = ""; my $x = undef; foreach $x (@a) { my $bin3=sprintf("%04b",hex($x)); @@ -867,11 +867,11 @@ CUL_TCM97001_Parse($$) # * E = Checksum # * F = 0000 0000 (W174!!!) my @a = split("", $msg); - my $bitReverse = undef; - my $bitUnreverse = undef; + my $bitReverse = ""; + my $bitUnreverse = ""; my $x = undef; my $bin3; - foreach $x (@a) { + foreach $x (@a) { $bin3=sprintf("%024b",hex($x)); $bitReverse = $bitReverse . substr(reverse($bin3),0,4); $bitUnreverse = $bitUnreverse . sprintf( "%b", hex( substr($bin3,0,4) ) ); @@ -961,8 +961,8 @@ CUL_TCM97001_Parse($$) # * E = Checksum my @a = split("", $msg); - my $bitReverse = undef; - my $bitUnreverse = undef; + my $bitReverse = ""; + my $bitUnreverse = ""; my $x = undef; my $bin3; my $hlen = length($msg); @@ -1515,7 +1515,7 @@ CUL_TCM97001_Parse($$) # 000011010100 11011110 # 212 222-156=66 my @a = split("", $msg); - my $bitReverse = undef; + my $bitReverse = ""; my $x = undef; foreach $x (@a) { $bitReverse = $bitReverse . reverse(sprintf("%04b",hex($x)));