Ethereal-dev: Re: [Ethereal-dev] void pointer arithmetics

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 11 Dec 2001 11:46:19 -0800 (PST)
> In revision 1.5 of gtk/tcp_graph.c, you changed it in the following
> way:
> 
> -       tcp = (struct tcphdr * )((char * )ip + 4*IHL(ip));
> +       tcp = (struct tcphdr * )(ip + 4*IHL((struct iphdr *)ip));
> 
> and eliminated the cast for the first occurrence of 'ip'. Is there any
> intention for this change?

"ip" changed from a structure pointer; I'd forgotten that it was a "void
*" - it should probably be changed to a "char *", instead.  (Yes, I know
that "void *" arithmetic is a GCCism.)