develooper Front page | perl.perl5.porters | Postings from December 2005

[PATCH] Sys::Syslog: remove NULL

Thread Next
From:
Brendan O'Dea
Date:
December 29, 2005 06:48
Subject:
[PATCH] Sys::Syslog: remove NULL
Is there a reason why Sys::Syslog terminates the message with a \0?  The
protocol would appear not to require a delimiter (RFC3164, §4.1.3).

This character apparently gets included in the messages logged by
syslog-ng.

Patch against 0.09 follows.

--bod

--- Sys/Syslog.pm.orig	2005-12-16 03:21:20.000000000 +1100
+++ Sys/Syslog.pm	2005-12-30 01:39:04.000000000 +1100
@@ -386,7 +386,7 @@
     $message = @_ ? sprintf($mask, @_) : $mask;
 
     $sum = $numpri + $numfac;
-    my $buf = "<$sum>$whoami: $message\0";
+    my $buf = "<$sum>$whoami: $message";
 
     # it's possible that we'll get an error from sending
     # (e.g. if method is UDP and there is no UDP listener,

Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About