Date: Sat, 18 May 2002 09:16:48 +1200 From: Jonathan Chen <jonc@chen.org.nz> To: "Terry R. Friedrichsen" <terry@uplift.sunquest.com> Cc: questions@FreeBSD.ORG Subject: Re: printf(3) problem? Message-ID: <20020518091648.A85520@grimoire.chen.org.nz> In-Reply-To: <200205171038.DAA52246@uplift.sunquest.com>; from terry@uplift.sunquest.com on Fri, May 17, 2002 at 03:38:18AM -0700 References: <200205171038.DAA52246@uplift.sunquest.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 17, 2002 at 03:38:18AM -0700, Terry R. Friedrichsen wrote:
>
>
> I've never tried this before, so I may simply be doing it wrong. I'm using
> FreeBSD 4.5-RELEASE, and the following program appears to print the wrong
> thing. I'm somewhat buoyed by the fact that Tru64 and Linux agree with me.
>
> My belief is that the correct output of this program should be:
>
> p1,p2 = 00000000000000012345,00000000000000067890
>
> but FreeBSD prints instead:
>
> p1,p2 = 00000000000000012345,20
>
> Have I missed something here?
>
I happen to agree with you; you may want to sendpr(1) your
observations.
Cheers.
--
Jonathan Chen <jonc@chen.org.nz>
----------------------------------------------------------------------
"Lots of folks confuse bad management with destiny"
- Kin Hubbard
> --------------------------------------cut here---------------------------
> #include <stdio.h>
> #include <stdlib.h>
>
> #include <sys/types.h>
>
> #define ULONG_LEN (size_t)20
>
>
>
> main()
>
> {
> off_t p1, p2;
>
> p1 = 12345; p2 = 67890;
>
> printf("p1,p2 = %0*lu,%0*lu\n", ULONG_LEN, p1, ULONG_LEN, p2);
>
> exit(0);
> }
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020518091648.A85520>
