[syslog-ng]Syslog-ng 1.6.4 adds ^@ to each line

michihito matsubara syslog-ng@lists.balabit.hu
Fri, 04 Jun 2004 23:10:37 +0900


Hi.

i've been watching for this thread because of my old YAMAHA ISDN router has
same output as well as Benjamin's.

On Fri, 4 Jun 2004 14:45:15 +0200
Subject: RE: [syslog-ng]Syslog-ng 1.6.4 adds ^@ to each line
Benjamin.Zoeller@salt-solutions.de wrote:

> Sorry I can't compile this. Get the following error.

Done againt syslog-ng-1.6.4+20040604 and gotya.
on Linux, gcc-3.3.2, glibc-2.3.1, libnet-1.1.1.
Now, there is no ^@ code at each end of lines.
Works very fine.

> > Can you check if this patch works? (it fixed the problem for me)
> > 
> > diff -u -r1.37.4.2 sources.c
> > --- src/sources.c       10 Mar 2004 18:43:28 -0000      1.37.4.2
> > +++ src/sources.c       4 Jun 2004 12:28:26 -0000
> > @@ -120,6 +120,13 @@
> >                    full or we are a datagram receiver, when the
> >                    message is in its own packet.
> >                  */
> > +               if (closure->dgram) {
> > +                       /* strip one trailing LF or NUL character */
> > +                       if (closure->pos > 0 &&
> > +                           (closure->buffer[closure->pos - 1] ==
> > '\n' || +                            closure->buffer[closure->pos -
> > 1] == '\0')) +                               closure->pos--;
> > +               }
> >                 do_handle_line(closure, closure->pos,
> >                 closure->buffer, salen ? (abstract_addr *) &sabuf :
> >                 NULL, salen); closure->pos = 0; return ST_OK |
> > ST_GOON; 


Benjamin,

looks like you missed something for the patch.
double check and try again. you can make it, too.
This patch is nothing but a clean and simple.

regards,
mitch

-- 
Musashino-shi, Tokyo, Japan
K12LTSP in Japanese ; http://open-mitch.dyndns.org/k12ltsp/