Re: strtonum(3) in FreeBSD?

From: Ballance, Robert T <tyler_at_neo.tamu.edu>
Date: Wed, 13 Apr 2005 03:20:10 -0000
> > Based on the man page, I see the following deficiencies:
> > 1) No support for bases other than 10
> > 2) No provision to return the end of the converted string
> > 3) No simple way to distinguish errors from a valid zero.
> 
> It actually has a sensible way of distinguishing errors (it always
> sets errno, even if to 0), but this is unintuitive to anyone who
> is used to the broken POSIX way of doing it.  It's a nice attempt,
> but consistency is important, too.  So unless we really need it, I
> would vote against it as well.

I agree with both of the latter two problems...I am wondering if it'd be
possible to talk to Theo about changing strtonum(3) in OpenBSD as well...we
(the MirOS Project) asked Theo about the intmax_t idea, and he simply replied
"No" (in classic Theo fashion, sans flames) 

Having no way to distinguish a valid zero is slightly retarded; in general, I
think it's a decent idea, but needs some polishing up. I'm not pushing real
hard for it though, since some other utilities exist (atoi(), strtol(), etc),
but it would be something handy to have around...

-R. Tyler Ballance
Received on Wed Apr 13 2005 - 01:20:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:32 UTC