Date: Wed, 13 Dec 2006 13:15:26 +0000 (UTC) From: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> To: Max Laier <max@love2party.net> Cc: freebsd-net@freebsd.org Subject: Re: ip6_sprintf patch Message-ID: <20061213125854.E91892@maildrop.int.zabbadoz.net> In-Reply-To: <200612121458.21401.max@love2party.net> References: <20061212111134.J91892@maildrop.int.zabbadoz.net> <200612121458.21401.max@love2party.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 12 Dec 2006, Max Laier wrote:
> On Tuesday 12 December 2006 13:22, Bjoern A. Zeeb wrote:
>> + }
>> + *cp = digits[*d & 0xf];
>
>> + if (zero == 0 || (*cp != '0'))
>> + cp++;
>
> This last if is redundant as we check for "(u_int16_t)0" at the very
> begining. If we didn't, you should still get rid of the if-check here as
> we might otherwise have more than one "::" in the address.
>
>> *cp++ = ':';
>> a++;
>> }
ok looks like
..
}
*cp++ = digits[*d & 0xf];
*cp++ = ':';
a++;
}
now.
And I have run some tests (in case someone wants to check):
http://sources.zabbadoz.net/freebsd/ipv6/ip6_sprintf.c
Thanks.
--
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061213125854.E91892>
