bsd-snprintf [was: openssh-2.1.1p1 on Irix6.2 report]

Sven Mascheck mascheck at faw.uni-ulm.de
Thu Jun 29 02:08:03 EST 2000


Ben Lindstrom wrote:

> NeXT 3.3 and OpenStep 4.2 dislike the bsd-snprintf.c ..I have two throw
> togethers that work.  But they are not portable.  I've not looked at the
> LPRNG snprintf.c  Which supposable is highly portable.  The current
> version depents on setjmp() which is not part of the NeXT OS.  (And looks
> like would be a mess to implement.)

Yes, the bsd-snprintf uses signal handling for buffer overrun
in vsnprintf().

Damien Miller once mentioned the snprintf.c from XFree86.
This derives from an original by Patrick Powell.
This original lacks floating point support, btw.

You may be interested in another modified version of this
original, too. It's from the mutt package:

Improved floating point support, i think the XFree one lacks this.
It deals with systems having only one of the two functions.
It comes with a selftest (switched on via define).
There is neither signal handling nor mprotect required.
No changes have been necessary for a long time now.

It compiled "out of the box" on Solaris2.5 and OSF1/V4.0b.
But i have no NeXT.

It may at least inspire you, like the XFree one.
Have a glance at <URL:http://www.uni-ulm.de/~s_smasch/snprintf.c>

However, i have no clue if there are even better versions available.

Sven
-- 





More information about the openssh-unix-dev mailing list