Date: Sun, 22 Nov 1998 07:42:53 -0800 From: Don Lewis <Don.Lewis@tsc.tdk.com> To: obrien@NUXI.com, Archie Cobbs <archie@whistle.com> Cc: freebsd-current@FreeBSD.ORG Subject: Re: snprintf() in the kernel Message-ID: <199811221542.HAA01025@salsa.gv.tsc.tdk.com> In-Reply-To: "David O'Brien" <obrien@NUXI.com> "Re: snprintf() in the kernel" (Nov 19, 8:30pm)
next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 19, 8:30pm, "David O'Brien" wrote: } Subject: Re: snprintf() in the kernel } > 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. I think the correct thing to do in many cases is to trap this and return the appropriate error. Silent truncation may introduce other bugs. --- Truck To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811221542.HAA01025>