httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: and now back to snprintf (fwd)
Date Wed, 15 Jan 1997 20:44:45 GMT
Marc Slemko wrote:
> 
> On Wed, 15 Jan 1997, Jim Jagielski wrote:
> 
> > Marc Slemko wrote:
> > > 
> > > Cough.
> > > 
> > > I don't see how this works.  Either you have to allocate an array of
> > > infinite length or you have to parse and modify the format string, no?
> > 
> > Here's what I do.
> > 
> > 	char temp[20480];
> > 	written = sprintf(temp, ......)
> > 
> > I then check to see if written > 20480 and if so generate an
> > error just in case. I then do a min of written and the len
> > parameter to snprintf() and copy from temp to the actual
> > buffer. I clear out temp[], just in case as well and return.
> 
> Ugh.  Double ugh.  Triple ugh.
> 
> I just plain don't like it.
> 

I fail to see how you feel all fine and dandy about just a stupid
wrapper yet Ugh away with a wrapper that at least attempts to
let the WebAdmin know what's going on and allows for abort() for
the paranoid.
-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
                  "Not the Craw... the CRAW!"

Mime
View raw message