Re: [Freeciv-Dev] snprintf, again
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Alex Zepeda wrote:
> Say what you will, but I think that grabbing an appropiate copy of
> snprintf and vnprintf is a very easy thing to do,
Well, so far no-one has done so for freeciv, and this issue
has been around for a while...
> and will require very little maintenence.
Easy for you to say ;-)
> Snprintf would be implemented on top of vnprintf
Certainly (assuming you really mean vsnprintf).
> which if not available would be IIRC implemented on top of vprintf which
> nearly everything has AFAIK.
Huh? If only it were so easy -- the whole problem is that one
can't safely implement vsnprintf on top of vsprintf, without
doing some trickery like mprotect(), or calculating an upper
bound and malloc/strncpy/free, or similar.
> For example, Apache, ssh, KDE, Qt, and IIRC even Gnome have snprintf
> implemented in a rather portable manner. Finding a ready made copy is IMO
> much easier than reinventing the wheel.
If you think so, I certainly invite you (or anyone else) to
volunteer to find such an appropriate implementation and submit
a patch to add it to freeciv.
And be prepared to argue that it doesn't suffer (or doesn't
suffer too much) from previously mentioned problems :-)
And note the licensing must be suitable: apache I think is
maybe not (advertising and other clauses); ssh is not open
source; Qt remains problematic wrt GPL despite QPL.
My previous post was made _after_ previously looking at a few such
implementations (though certainly not exhastively), and finding
a variety of methods (indeed unfortunately _not_ finding one
drop-in implementation which everyone clearly agrees is best),
with all of them having perceived problems with complexity and/or
portability.
Regards,
-- David
- [Freeciv-Dev] snprintf, again, David Pfitzner, 1999/08/23
- [Freeciv-Dev] Re: snprintf, again, David Pfitzner, 1999/08/22
- Re: [Freeciv-Dev] snprintf, again, Alex Zepeda, 1999/08/23
- Re: [Freeciv-Dev] snprintf, again,
David Pfitzner <=
- Re: [Freeciv-Dev] snprintf, again, Alex Zepeda, 1999/08/24
- Re: [Freeciv-Dev] snprintf, again, David Pfitzner, 1999/08/25
- Re: [Freeciv-Dev] snprintf, again, Alex Zepeda, 1999/08/25
- Re: [Freeciv-Dev] snprintf, again, David Pfitzner, 1999/08/25
- Re: [Freeciv-Dev] snprintf, again, Alex Zepeda, 1999/08/25
- Re: [Freeciv-Dev] snprintf, again, David Pfitzner, 1999/08/25
- Re: [Freeciv-Dev] snprintf, again, Alex Zepeda, 1999/08/25
- Re: [Freeciv-Dev] snprintf, again, Andy Black, 1999/08/25
- [Freeciv-Dev] Re: snprintf, again, Sebastian Bauer, 1999/08/26
- RE: [Freeciv-Dev] snprintf, again, Todd Goodman, 1999/08/26
|
|