[DGD] Re: sprintf

Greg Lewis glewis at eyesbeyond.com
Fri Apr 2 00:27:53 CEST 2004


On Thu, Apr 01, 2004 at 03:27:47PM -0600, Erwin Harte wrote:
> On Thu, Apr 01, 2004 at 04:14:16PM -0500, Michael McKiel wrote:
> [...]
> > I think (though I may be in the minority) that one of DGD's few downfalls is
> > the lack of understanding in how to go about doing a driver extension. In
> > other LPC sources it wouldn't seem to be as much of an undertaking. It would
> > seem that if there was a greater comprehension there, you'd find more binary
> > option/"addons" than just lpc-code thats frequently LIB dependant.
> 
> While the downside of linking in a sprintf() from an outside source is
> that you may get different behaviour depending on what platform you're
> compiling your driver on with as effect that the mudlib may work on
> your main server but may misbehave on a test-copy elsewhere.

In theory you should be able to rely on the native implementation of
sprintf adhering to a standard (its been standardised in things like ISO C
and POSIX/SUS for quite some time).  Of course, that doesn't guarantee
anything, but given its been a standard for a long time it should be
reliable in this case.

> Additionally you get all the potential buffer overflows and such for
> free while ignoring DGD's sturdy built-in string type.

Only if you actually implemented sprintf on top of the native sprintf.
We're all going to implement it on top of snprintf right?  Still, there
are some things to think about.

I'd use the LPC version personally, if I really wanted sprintf, which
I don't.

-- 
Greg Lewis                          Email   : glewis at eyesbeyond.com
Eyes Beyond                         Web     : http://www.eyesbeyond.com
Information Technology              FreeBSD : glewis at FreeBSD.org

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list