httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: PLEASE try compiling snprintf.c (was: Re: snprintf.c uploaded)
Date Sun, 12 Jan 1997 21:52:02 GMT
Marc Slemko wrote:
> 
> On Sun, 12 Jan 1997, Jim Jagielski wrote:
> 
> > Marc Slemko wrote:
> > > 
> > > Try linking something and you will notice that you need cvt, gcvt, etc.
> > > I think cvt.c and gvct.c are all that I needed to add to make it work.
> > > >From my tests, I think there are a few bugs to hunt down in the code
> > > too...
> > 
> > Hmmm... on the systems I've tried, *cvt()s are already available :/
> 
> Oh.  Which ones?
> 
> Solaris, AIX, SunOS and IRIX do.  FreeBSD and BSD/OS don't.

Don't FreeBSD and BSD/OS have snprintf()? If so, then they don't
need our version.

> Oh, and it appears like strx_printv acts like strncpy in that it does not
> null terminate the buffer if it has to truncate the string.  That is bad. 
> I _think_ the below patch should fix it. 
> 
> --- snprintf.c	1997/01/12 08:39:48	1.1
> +++ snprintf.c	1997/01/12 20:30:33
> @@ -725,7 +725,7 @@
>      * Do the conversion
>      */
>      cc = __sio_converter( &od, -1, format, ap ) ;
> -    if ( len == 0 || od.nextb < od.buf_end )
> +    if ( len == 0 || od.nextb <= od.buf_end )
>  	*(od.nextb) = '\0' ;
>      if ( ccp )
>  	*ccp = cc ;
> 

Looks good

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

Mime
View raw message