Date: Fri, 04 Aug 2000 13:31:20 +0200 From: Sheldon Hearn <sheldonh@uunet.co.za> To: Kris Kennaway <kris@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/rpc netname.c Message-ID: <9999.965388680@axl.ops.uunet.co.za> In-Reply-To: Your message of "Fri, 04 Aug 2000 04:07:57 MST." <200008041107.EAA50182@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 04 Aug 2000 04:07:57 MST, Kris Kennaway wrote: > Modified files: > lib/libc/rpc netname.c > Log: > Calculate the string length of a u_long at compile-time, instead of using a > hardcoded value. before you go off doing that everywhere, you may want to check out STRBUF_SIZEOF() in ls.c, which looks like this: /* * Upward approximation of the maximum number of characters needed to * represent a value of integral type t as a string, excluding the * NUL terminator, with provision for a sign. */ #define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1) Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9999.965388680>