You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by rb...@apache.org on 2002/08/22 21:07:41 UTC

apr_snprintf not compliant

apr_snprintf and apr_vsnprintf are not compliant with the POSIX snprint
standard currently.  There are two problems.  1)  a length of 0 should
allow the buffer to be NULL, and it should return the computed length of
the requested string.  This doesn't currently happen.  2)  Specifying a
string precision doesn't work correctly.  The common reason for specifying
a string precision, is that you don't ahve a NULL-terminated string, but
we always call strlen on the string that is passed in.  Problem 2 is in
GNATS as bug 8554, and it has a fix.  Problem 1 is not in any bug DB, but
I have a fix already.

My question, is whether we really want to fix these problems, because we
don't _have_ to be POSIX compliant.  My own opinion is that they should be
fixed.

Ryan


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
550 Jean St
Oakland CA 94610
-------------------------------------------------------------------------------


Re: apr_snprintf not compliant

Posted by Branko Čibej <br...@xbc.nu>.
David Reid wrote:

>+1 on fixing both.
>  
>
Same here.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


Re: apr_snprintf not compliant

Posted by David Reid <dr...@jetnet.co.uk>.
+1 on fixing both.

david

----- Original Message -----
From: <rb...@apache.org>
To: <de...@apr.apache.org>
Sent: Thursday, August 22, 2002 8:07 PM
Subject: apr_snprintf not compliant


>
> apr_snprintf and apr_vsnprintf are not compliant with the POSIX snprint
> standard currently.  There are two problems.  1)  a length of 0 should
> allow the buffer to be NULL, and it should return the computed length of
> the requested string.  This doesn't currently happen.  2)  Specifying a
> string precision doesn't work correctly.  The common reason for specifying
> a string precision, is that you don't ahve a NULL-terminated string, but
> we always call strlen on the string that is passed in.  Problem 2 is in
> GNATS as bug 8554, and it has a fix.  Problem 1 is not in any bug DB, but
> I have a fix already.
>
> My question, is whether we really want to fix these problems, because we
> don't _have_ to be POSIX compliant.  My own opinion is that they should be
> fixed.
>
> Ryan
>
>
>
____________________________________________________________________________
___
> Ryan Bloom                        rbb@apache.org
> 550 Jean St
> Oakland CA 94610
> --------------------------------------------------------------------------
-----
>
>