[PATCH] restructure struct initialization aesthetically

Robert P. J. Day rpjday at mindspring.com
Tue Jun 20 15:25:53 UTC 2006


On Tue, 20 Jun 2006, Rich Felker wrote:

> On Tue, Jun 20, 2006 at 11:17:57AM -0400, Robert P. J. Day wrote:
> >
> >   just to make a couple struct initializations easier to read.
> >
> > rday
> > diff -pru busybox/networking/interface.c busybox.new/networking/interface.c
> > --- busybox/networking/interface.c	2006-06-20 11:14:13.000000000 -0400
> > +++ busybox.new/networking/interface.c	2006-06-20 11:15:59.000000000 -0400
> > @@ -126,13 +126,12 @@ static char *INET_sprint(struct sockaddr
> >  }
> >
> >  static struct aftype inet_aftype = {
> > -	"inet", "DARPA Internet", AF_INET, sizeof(unsigned long),
> > -	NULL /* UNUSED INET_print */ , INET_sprint,
> > -	NULL /* UNUSED INET_input */ , NULL /* UNUSED INET_reserror */ ,
> > -	NULL /*INET_rprint */ , NULL /*INET_rinput */ ,
> > -	NULL /* UNUSED INET_getnetmask */ ,
> > -	-1,
> > -	NULL
> > +	.name =		"inet",
> > +	.title =	"DARPA Internet",
> > +	.af =		AF_INET,
> > +	.alen =		sizeof(unsigned long),
> > +	.sprint =	INET_sprint,
> > +	.fd =		-1
> >  };
>
> This contains a bug: sizeof(unsigned long) is incorrect for AF_INET
> addresses. It should merely be 4. The former will break 64bit
> platforms.

ok, i can correct that and re-submit.  i was just going off of the
previous contents.

rday



More information about the busybox mailing list