Re: question about change in inet_ntoa.c
- From: Giorgos Keramidas <keramida@xxxxxxxxxxxxxxx>
- Date: Tue, 26 Feb 2008 06:04:38 +0200
On 2008-02-23 02:37, ithilgore <ithilgore.fbsd@xxxxxxxxx> wrote:
ithilgore wrote:
I was looking at the differences between some old FreeBSD code
and the one of 7.0-RC1 and was wondering about a change
in inet_ntoa.c
/***** 7.0-RC1 **************/
sprintf(buf, "%d.%d.%d.%d",
ucp[0] & 0xff,
ucp[1] & 0xff,
ucp[2] & 0xff,
ucp[3] & 0xff);
/****** 4.11-RELEASE ***********/
static const char fmt[] = "%u.%u.%u%u";
if ((size_t)snprintf(dst, size, fmt, src[0], src[1], src[2], src[3])
>= size) {
....
....
Was there a specific purpose of changing the more easy and simple way
of %u instead of the combination of %d and and-ing with 0xff ??
It essentially gives the same result but increases overhead (i think) in
the more
recent version.
I just noticed I made a mistake. The second code is libc's version of
inet_ntoa. But the question still counts. Why not use the plain
simpler version of libc ?
I don't see ucp[] in RELENG_6, RELENG_7 or CURRENT. Where did you get
the version shown as `7.0-RC1' above?
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: question about change in inet_ntoa.c
- From: ithilgore
- Re: question about change in inet_ntoa.c
- References:
- question about change in inet_ntoa.c
- From: ithilgore
- Re: question about change in inet_ntoa.c
- From: ithilgore
- question about change in inet_ntoa.c
- Prev by Date: Re: FBSD 1GBit router?
- Next by Date: Re: vlan issues with 7.0-RC3
- Previous by thread: Re: question about change in inet_ntoa.c
- Next by thread: Re: question about change in inet_ntoa.c
- Index(es):
Relevant Pages
- Re: question about change in inet_ntoa.c
... ithilgore wrote: ... Was there a specific purpose of changing the more
easy and simple way ... Why not use the plain simpler version of libc? ...
(freebsd-net) - Re: What am I missing without mutt?
... for plain text OOo and Word are terrible tools. ... To me using Thunderbird
to send email is like ... Mutt is made for the purpose of managing ... Yes, mutt
can. ... (Debian-User) - Re: What am I missing without mutt?
... for plain text OOo and Word are terrible tools. ... To me using Thunderbird
to send email is like ... Mutt is made for the purpose of managing ... in mutt
can I have several ... (Debian-User) - Re: What am I missing without mutt?
... for plain text OOo and Word are terrible tools. ... Mutt is made for the purpose
of managing ... it's much more efficient and programmable than a gui email program ...
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... (Debian-User) - Re: HOW TO TELL IF YOU ARE TRULY A LIBERAL
... you are lying on purpose. ... Why would you pretend to know when
you ... Pretty plain to me, he left the choice up to you. ... (rec.outdoors.rv-travel)