From 6cbd5fddd7e5be2746d0ceb017aaedd88717848b Mon Sep 17 00:00:00 2001 From: yaworsky Date: Tue, 29 Nov 2005 13:34:12 +0000 Subject: Convert all parts of logged message to destination encoding. This is required if destination encoding is UCS-2 or UCS-4 for example. Otherwise the logfile will not be uniform. Fixed a bug in charset conversion function: divide by zero when cannot convert the first character and calculating new size for the output buffer. --- daemon/dest_relay.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'daemon/dest_relay.c') diff --git a/daemon/dest_relay.c b/daemon/dest_relay.c index 0ddf675..701c2c3 100755 --- a/daemon/dest_relay.c +++ b/daemon/dest_relay.c @@ -100,10 +100,11 @@ static void put_message_to_relay_dest( struct destination* destination, struct m pri = string_printf( "<%d>", LOG_MAKEPRI( msg->facility, msg->priority ) ); if( destination->u.relay.omit_hostname ) - len = string_concat( &buffer, pri, msg->timestamp, space, msg->message, line_feed, NULL ); + len = string_concat( &buffer, pri, msg->timestamp, msg->separator, + msg->message, msg->end_of_line, NULL ); else - len = string_concat( &buffer, pri, msg->timestamp, space, - msg->hostname, space, msg->message, line_feed, NULL ); + len = string_concat( &buffer, pri, msg->timestamp, msg->separator, msg->hostname, + msg->separator, msg->message, msg->end_of_line, NULL ); string_release( pri ); if( len > 1024 ) -- cgit v1.2.3