[Python-Dev] Patches

Greg Stein gstein@lyra.org
Tue, 18 Jul 2000 23:55:59 -0700

On Wed, Jul 19, 2000 at 06:17:49AM +0000, Peter Schneider-Kamp wrote:
> Fredrik Lundh wrote:
> > 
> > > -0 on that, I'd rather use snprintf when available, sprintf when not.

Falling back to sprintf() is just untenable.

> > strange argument.  why is it okay to crash Python on Windows,
> > pure SUSv2 platforms, pure ANSI C platforms, etc?
> I was assuming that most modern systems have a sprintf function

(I presume you meant snprintf here)

Yes, most do, but it isn't quite the same...

> available. If this is not the case, my argument is indeed void.
> I was extrapolating from the fact that it's available on the
> systems I work on (linux, sunos, solaris).
> > besides, snprintf doesn't do the same thing as my PyErr_Format
> > replacement...
> Yes, but it would by possible to use snprintf in PyErr_Format.

still not quite the same. /F's PyErr_Format returns an arbitrary length
string. snprintf() would be cut at some pre-specified limit.


Greg Stein, http://www.lyra.org/