Only try to strip off the leading newline if there's actually
authordjfiander <djfiander>
Fri, 17 Oct 2008 23:57:52 +0000 (23:57 +0000)
committerdjfiander <djfiander>
Fri, 17 Oct 2008 23:57:52 +0000 (23:57 +0000)
content in the record at all (eliminate perl 'Use of
uninitialized value' warning).

Sip.pm

diff --git a/Sip.pm b/Sip.pm
index a1e586c..68379c1 100644 (file)
--- a/Sip.pm
+++ b/Sip.pm
@@ -176,7 +176,7 @@ sub read_SIP_packet {
     # So, the simplest thing to do is just throw away a leading newline
     # on the input.
     # 
-    $record =~ s/^\012//;
+    $record =~ s/^\012// if $record;
     syslog("LOG_INFO", "INPUT MSG: '$record'") if $record;
     return $record;
 }