From owner-freebsd-hackers Mon Nov 9 12:44:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA19181 for freebsd-hackers-outgoing; Mon, 9 Nov 1998 12:44:42 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA19174 for ; Mon, 9 Nov 1998 12:44:41 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id MAA00772; Mon, 9 Nov 1998 12:43:14 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199811092043.MAA00772@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: zhihuizhang cc: hackers Subject: Re: radix argument of kvprintf() In-reply-to: Your message of "Mon, 09 Nov 1998 12:12:29 EST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Nov 1998 12:43:14 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I try to figure out the meaning of the argument radix in the routine > kvprintf() in file subr_prf.c. I find that radix can be values from > 2 through 36 and is only used when you have a %n in the format. > > The specifier %n is supposed to save the number of characters we have > printed so far. But the source code of kvprintf() does not show this. > Instead, it specifies we want to print the next argument with base value > of radix. This is inconsistent with what is said about printf(3). > > Can anyone explain this for me? Thanks a lot. I think that the %n behaviour is an error; it may have been meant to be implemented but never was. The correct format specifier for the radix is %r. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message