[PATCH] Fix ether_ntoa() output format

Mathieu Lacage mathieu.lacage@sophia.inria.fr
Sun Aug 1 23:30:00 GMT 2010


On Thu, 2010-07-29 at 07:31 -0700, Ulrich Drepper wrote:

> > I have bumped into issue in ether_ntoa() implementation.
> > All leading zeros were suppressed.
> > e.g instead of 00:01:13:25:18:fa
> > 0:1:13:25:18:fa is printed.
> 
> And the problem is?  This is perfectly valid for all I know.  You cannot
> just claim there is a problem without backing this up.

As you point out, the current behavior (remove leading zeros) is correct
and valid but could be made more helpful by generating a fixed-size
string because this makes it easier for the users of this function to
generate a nice-looking output. Of course, this is subjective, but I
fail to see how the current behavior could be judged more useful than
the proposed behavior according to any metric.

Mathieu



More information about the Libc-alpha mailing list