diff options
author | yaworsky <yaworsky> | 2005-11-29 13:34:12 +0000 |
---|---|---|
committer | yaworsky <yaworsky> | 2005-11-29 13:34:12 +0000 |
commit | 6cbd5fddd7e5be2746d0ceb017aaedd88717848b (patch) | |
tree | 0a0367e9c9b998786acdc01a99dd10fb60d0dee0 /daemon/dest_relay.c | |
parent | 447ff54953c6fd528f161a6d5ab18593db9ad490 (diff) | |
download | syslog-win32-6cbd5fddd7e5be2746d0ceb017aaedd88717848b.tar.gz syslog-win32-6cbd5fddd7e5be2746d0ceb017aaedd88717848b.tar.xz syslog-win32-6cbd5fddd7e5be2746d0ceb017aaedd88717848b.zip |
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.
Diffstat (limited to 'daemon/dest_relay.c')
-rwxr-xr-x | daemon/dest_relay.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 ) |