httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: ap_snprintf
Date Mon, 13 Jan 1997 00:46:52 GMT
Marc Slemko wrote:
> 
> With ap_snprintf, if you do a:
>         ap_snprintf(buf, 7, "%.6d", -10);
> 
> you will get "-00001" in buf.  With some other snprintf()s, you would get
> "-00010" in buf. 
> 
> Can anyone think of any reason this could cause a problem? 
> 

Not really, in fact, it appears that ap_snprintf is more correct.
After all, if you don't worry about the buffer size, buf gets
"-000010", so when you limit it to 7 chars, "-00001" makes
sense.


-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
                  "Not the Craw... the CRAW!"

Mime
View raw message