[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: need help on #271678 (sizefo struct?)



On Mon, May 16, 2005 at 12:06:37PM +0200, Bernd Eckenfels wrote:

||  In article <[🔎] 20050516081733.GA12100@love.sense.znet> you wrote:

||  {
||    struct x25_route_struct rt;
||    struct sockaddr_x25 sx25;
||  ...
||    memset((char *) &rt, 0, sizeof(struct x25_route_struct));

      memset((char *) &rt, 0, sizeof rt);

It's actually better, because the consistency of this code doesn't depend
on the actual type of "rt".  Inform upstream.

||  ...
||    /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
||    memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address));
||  ...

||  >    memcpy(&rt.address, &sx25.sx25_addr, sizeof sx25.sx25_addr);
||  > This will work with either definition of sx25_address.
||
||  thanks  for your  help, will do that (however i prefer the paranteses :)

As you wish.  It's your package.

Ciao.                                                            Vincent.
-- 
Vincent Zweije <zweije@xs4all.nl>    | "If you're flamed in a group you
<http://www.xs4all.nl/~zweije/>      | don't read, does anybody get burnt?"
[Xhost should be taken out and shot] |            -- Paul Tomblin on a.s.r.

Attachment: signature.asc
Description: Digital signature


Reply to: