Received: by taz.hyperreal.com (8.8.3/V2.0) id NAA04696; Sun, 12 Jan 1997 13:52:15 -0800 (PST) Received: from shado.jaguNET.com by taz.hyperreal.com (8.8.3/V2.0) with ESMTP id NAA04656; Sun, 12 Jan 1997 13:52:07 -0800 (PST) Received: (from jim@localhost) by shado.jaguNET.com (8.8.4/jag-2.4) id QAA05655 for new-httpd@hyperreal.com; Sun, 12 Jan 1997 16:52:03 -0500 (EST) From: Jim Jagielski Message-Id: <199701122152.QAA05655@shado.jaguNET.com> Subject: Re: PLEASE try compiling snprintf.c (was: Re: snprintf.c uploaded) To: new-httpd@hyperreal.com Date: Sun, 12 Jan 1997 16:52:02 -0500 (EST) In-Reply-To: from "Marc Slemko" at Jan 12, 97 01:58:46 pm X-Mailer: ELM [version 2.4 PL25] Content-Type: text Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com 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!"