httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Clary <jcl...@futurefx.com>
Subject Re: snprintf.c uploaded
Date Sun, 12 Jan 1997 01:04:05 GMT

There is an asprintf on some systems which already does dynamic allocation
but I don't know how portable it is..  A look at the linux header files
shows its specific to GNU, so maybe its portable in so far as you stick
with GNU..  or maybe not.. 

But, It would be best to use the pool allocation system already standardized
in Apache, I'm sure..  And that snprintf() code could probably be
modified to do the allocation.. Its just a matter of adding up the
length of the format string minus the format specifiers and figure
up how long each inserted value is..  kindof a pain in the butt really,
but endless benefits for security and support.

> 
> >From the fingers of Jason Clary flowed the following:
> >
> >Btw, keep in mind the other alternative for the future..  a psprintf()
> >that creates a new pointer to a string dynamicly allocated out of the
> >pool.  Like I said, I havent even looked at your pool code but if
> >anyone things its a good idea but noone wants to code it, I'll do it.
> 
>     I haven't examined the pool code in detail, either, but this sounds
>     like a real win.  IMHO.
> 
>     #ken    :-)}
> 


Mime
View raw message