On Tue, Aug 02, 2011 at 04:16:49PM +0200, David Coppa wrote:

> On Tue, Aug 2, 2011 at 4:07 PM, Christian Weisgerber <na...@mips.inka.de> 
> wrote:
> > David Coppa:
> >
> >> +--- src/protocols/ec_tcp.c.orig ? ? ?Tue Sep 28 11:56:13 2004
> >> ++++ src/protocols/ec_tcp.c ? Tue Aug ?2 09:59:46 2011
> >> +@@ -116,7 +116,7 @@ FUNC_DECODER(decode_tcp)
> >> + ? ?tcp = (struct tcp_header *)DECODE_DATA;
> >> +
> >> + ? ?opt_start = (u_char *)(tcp + 1);
> >> +- ? opt_end = (u_char *)((int)tcp + tcp->off * 4);
> >> ++ ? opt_end = (u_char *)(((u_char *)tcp) + tcp->off * 4);
> >
> > That's a bit silly. ?This will do:
> >
> > ?opt_end = (u_char *)tcp + tcp->off * 4;
> 
> So, is just removing the cast to int better?
> 
> opt_end = (u_char *)(tcp + tcp->off * 4);
> 

No, without the cast the offset will be computed in units of sizeof(*tcp).

        -Otto

Reply via email to