From owner-freebsd-arch Thu Jan 11 9:33:16 2001 Delivered-To: freebsd-arch@freebsd.org Received: from earth.backplane.com (placeholder-dcat-1076843399.broadbandoffice.net [64.47.83.135]) by hub.freebsd.org (Postfix) with ESMTP id 1AEFA37B400 for ; Thu, 11 Jan 2001 09:33:00 -0800 (PST) Received: (from dillon@localhost) by earth.backplane.com (8.11.1/8.9.3) id f0BHWC671100; Thu, 11 Jan 2001 09:32:12 -0800 (PST) (envelope-from dillon) Date: Thu, 11 Jan 2001 09:32:12 -0800 (PST) From: Matt Dillon Message-Id: <200101111732.f0BHWC671100@earth.backplane.com> To: Julian Elischer Cc: Poul-Henning Kamp , "Justin T. Gibbs" , Dag-Erling Smorgrav , freebsd-arch@FreeBSD.ORG Subject: Re: Proposed chage to sbuf semantics. References: <8607.979224359@critter> <3A5DCD67.66539A@elischer.org> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You guys are all crazy. I would just write an snappendf() function, similar to snprintf(), and use a static buffer. snappendf(buf, bufsize, ctl, ...); Have the function return the index of where the \0 would normally go had the buffer been big enough. So the last snappendf(): r = snappendf(...) if (r >= bufsize) ... data was truncated ... The routine is about 5 lines of code. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message