From owner-freebsd-questions Fri May 17 3:38:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from uplift.sunquest.com (uplift.hosp.misyshealthcare.com [149.138.10.246]) by hub.freebsd.org (Postfix) with ESMTP id 3BF5837B404 for ; Fri, 17 May 2002 03:38:26 -0700 (PDT) Received: (from terry@localhost) by uplift.sunquest.com (8.9.3/8.9.3) id DAA52246 for questions@freebsd.org; Fri, 17 May 2002 03:38:18 -0700 (MST) (envelope-from terry) Date: Fri, 17 May 2002 03:38:18 -0700 (MST) From: "Terry R. Friedrichsen" Message-Id: <200205171038.DAA52246@uplift.sunquest.com> To: questions@freebsd.org Subject: printf(3) problem? Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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? Thanks. Terry R. Friedrichsen terry@uplift.sunquest.com --------------------------------------cut here--------------------------- #include #include #include #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