[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more improvements for mg



On Mon, May 16, 2005 at 12:26:14AM +0200, Han Boetes wrote:
> Hi,
> 
> A few more improvements for mg:

> - Proper incantations for snprintf().


> +	size_t		 ret;

> +		ret = snprintf(file, sizeof(file), "%s/.mg", home);
> +		if ((int)ret == -1 || ret >= sizeof(file))

is this the preferred way in OpenBSD, casting to int?  I have pondered
this before when trying to make a single function that checks
snprintf, strlcat and strlcpy, based on the return value and the limit
used in those functions.

-- 
<jakemsr_(_at_)_jakemsr_(_dot_)_com>



Visit your host, monkey.org