From owner-cvs-all Fri Aug 4 4:31:36 2000 Delivered-To: cvs-all@freebsd.org Received: from axl.ops.uunet.co.za (axl.ops.uunet.co.za [196.31.2.163]) by hub.freebsd.org (Postfix) with ESMTP id D2C3237BA23; Fri, 4 Aug 2000 04:31:26 -0700 (PDT) (envelope-from sheldonh@axl.ops.uunet.co.za) Received: from sheldonh (helo=axl.ops.uunet.co.za) by axl.ops.uunet.co.za with local-esmtp (Exim 3.16 #1) id 13KfhA-0002bI-00; Fri, 04 Aug 2000 13:31:20 +0200 From: Sheldon Hearn To: Kris Kennaway Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/rpc netname.c In-reply-to: Your message of "Fri, 04 Aug 2000 04:07:57 MST." <200008041107.EAA50182@freefall.freebsd.org> Date: Fri, 04 Aug 2000 13:31:20 +0200 Message-ID: <9999.965388680@axl.ops.uunet.co.za> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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