Subject: Re: strtonum(3) in our libc
To: Mindaugas <firstname.lastname@example.org>
From: Bruce Korb <Bruce.Korb@gmail.com>
Date: 06/02/2006 19:29:40
>some time ago OpenBSD developers implemented strtonum(3) function which
>is safer implementation of atoi(3) and strtol(3) - it does bounds
>checking, error detection, etc. They use it several applications (e.g.
>OpenSSH has native implementation).
>This function doesn't conform to POSIX or any other standard, but it
>might be useful. FreeBSD also made decision to import this function into
>If there is some questions about this, to don't discuss it twice,
>checkout discussion in FreeBSD mailing list with OpenBSD folks:
>If there will be decision to import it, I attached patch and source with
>manual, which goes to src/lib/libc/stdlib :) Please review.
If you are going to add a range checking layer over strtoll, *PLEASE*
a variation that also has a base argument (and passed through to strtoll()).