tech-userlevel archive

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

Re: strtonum(3) from OpenBSD?



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...
-- 
Matt


Home | Main Index | Thread Index | Old Index