apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: apr_snprintf not compliant
Date Sun, 25 Aug 2002 13:32:00 GMT
Ryan Bloom wrote:
> 
> On Fri, 23 Aug 2002, Jim Jagielski wrote:
> 
> > We are already not compliant, since we overload %p.
> > 
> > Not sure if I understand #1: If len is 0, we return 0 and don't check
> > buff at all. Or do you mean a length of 0 (or 1) should set
> > *buffer to NULL?
> 
> right now, if length is 0, we return 0, and that is it.  However, the spec
> says that if length is zero, then *buffer is allowed to be NULL, but
> whether it is or isn't, *buffer isn't modified, and snprintf returns the
> number of characters that _would_ be returned if length was infinite.

Gotcha... Yeah, I checked the spec as well after I sent this :)

As long as we ensure that if len == 0 we don't touch *buffer, cool.
-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
      "A society that will trade a little liberty for a little order
             will lose both and deserve neither" - T.Jefferson

Mime
View raw message