Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Dec 2000 11:55:34 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        Dag-Erling Smorgrav <des@ofug.org>, arch@FreeBSD.ORG
Subject:   Re: %a and %A formats
Message-ID:  <20001210115534.G16205@fw.wintelcom.net>
In-Reply-To: <382.976476122@critter>; from phk@critter.freebsd.dk on Sun, Dec 10, 2000 at 08:22:02PM %2B0100
References:  <20001210111254.F16205@fw.wintelcom.net> <382.976476122@critter>

next in thread | previous in thread | raw e-mail | index | archive | help
* Poul-Henning Kamp <phk@critter.freebsd.dk> [001210 11:22] wrote:
> In message <20001210111254.F16205@fw.wintelcom.net>, Alfred Perlstein writes:
> >* Dag-Erling Smorgrav <des@ofug.org> [001210 06:46] wrote:
> >> Dag-Erling Smorgrav <des@ofug.org> writes:
> >> >     http://people.freebsd.org/~des/software/printf-20001209.diff
> >> 
> >> Oh, and I forgot - it builds, but hasn't been tested. You have been
> >> warned.
> >
> >Glancing at it, I don't see it working properly on different
> >endianness.
> >
> >Should it work?
> 
> I see nothing but regular string/char operations, where do you
> see endianess issues ?

Ok, maybe i'm not getting something here:

+               case 'a':
+                       p = va_arg(ap, char *);
+                       for (n = 0; n < 4; ++n, ++p) {
+                               tmp = (unsigned char)*p;
+                               if (tmp > 99 || padc == '0')
+                                       PCHAR('0' + tmp / 100);
+                               if (tmp > 9 || padc == '0')
+                                       PCHAR('0' + (tmp % 100) / 10);
+                               PCHAR('0' + tmp % 10);
+                               if (n < 3)
+                                       PCHAR('.');
+                       }
+                       break;

aren't sockaddrs in host format by the time they are printed?

if they are, how do we know it's like this:

a b c d

and not

d c b a

I think I need to make some coffee or something. :)

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001210115534.G16205>