tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: strtonum(3) from OpenBSD?




Am 23.06.2009 um 16:58 schrieb Matthew Mondor:

On Tue, 23 Jun 2009 16:28:11 +0200
Marc Balmer <marc%msys.ch@localhost> wrote:

OpenBSD has the strtonum(3) function to reliably convert string values
to an
integer since the 3.6 release.

I don't personally remember the previous thread about it, but the
various immediate problems I see with it:

Instead of returning an error code it returns a string, assuming the
only consumers are humans; also this error string is non-localizable.
Also, although it claims to be safer this is only a utility wrapper
around strtoll(3).

That said, if it is needed for portability because many programs expect
it in libc, it might be useful...

so why do we have strsuftoll? Looks like an over-engineered strtonum to me...

we now have four copies of strtonum in the tree, btw.


--
Matt



Home | Main Index | Thread Index | Old Index