Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Nov 1999 00:18:42 +0800 (WST)
From:      Michael Kennett <mike@laurasia.com.au>
To:        wollman@khavrinen.lcs.mit.edu (Garrett Wollman)
Cc:        current@freebsd.org
Subject:   Re: FreeBSD security auditing project.
Message-ID:  <199911241618.AAA28147@laurasia.com.au>
In-Reply-To: <199911241519.KAA29757@khavrinen.lcs.mit.edu> from Garrett Wollman at "Nov 24, 99 10:19:49 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett Wollman wrote:
> 
> Perhaps if name[] had been declared thus:
> 
> #define	INTTYPE_NCHARS(t) ((sizeof(t) * 3 * CHAR_BIT + 7) / 8)
> 
> 	char name[(sizeof "ipfw: ") + INTTYPE_NCHARS(int)];

Or alternatively (removing a bit more magic):

#include <sys/types.h>

#define INTTYPE_NCHARS(t)   (howmany (sizeof(t) * 3 * CHAR_BIT, 8))

The macro howmany() is quite useful. It is also in <sys/param.h>

Mike Kennett
(mike@laurasia.com.au)



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?199911241618.AAA28147>