From owner-freebsd-current Fri Nov 20 08:52:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA22182 for freebsd-current-outgoing; Fri, 20 Nov 1998 08:52:29 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA22170 for ; Fri, 20 Nov 1998 08:52:25 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.1/8.9.1) with ESMTP id IAA03616; Fri, 20 Nov 1998 08:51:55 -0800 (PST) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.1/8.9.1) id IAA18059; Fri, 20 Nov 1998 08:51:55 -0800 (PST) (envelope-from jdp@polstra.com) Date: Fri, 20 Nov 1998 08:51:55 -0800 (PST) Message-Id: <199811201651.IAA18059@vashon.polstra.com> To: obrien@NUXI.com Subject: Re: snprintf() in the kernel Newsgroups: polstra.freebsd.current In-Reply-To: <19981119203050.A4033@nuxi.com> References: <19981120093817.K467@freebie.lemis.com> <199811200057.QAA29023@bubba.whistle.com> Organization: Polstra & Co., Seattle, WA Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <19981119203050.A4033@nuxi.com>, David O'Brien wrote: > > The only subtle gotcha with snprintf() is that it returns > > the number of characters that *would* have been printed, > > not the number that actually were printed. > > So, create a new function called ksprintf() that has the calling semantics > of sprintf(), but the return semantics you like. Too confusing. Either make it act exactly like snprintf() (or at least a subset), or give it a dissimilar name. Extra much so, since there's unlikely to be a man page for the new function. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Nobody ever went broke underestimating the taste of the American public." -- H. L. Mencken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message