tech-userlevel archive

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

Re: Reuse strtonum(3) and reallocarray(3) from OpenBSD



On Jan 13,  3:43am, n54%gmx.com@localhost ("Kamil Rytarowski") wrote:
-- Subject: Re: Reuse strtonum(3) and reallocarray(3) from OpenBSD

| Hello,
| 
| I've divided the work to parts:
| 1. add strtoi, strtou, fullstrtoi. fullstrtou

I still don't get what you buy by having 2 sets of functions to save a passed
NULL pointer... Aside confusion.

| 2. add efuns
| 3. add manpages
| 4. add strtonum(3) as _OPENBSD_SOURCE

I am fine with the rest, I don't see a need for the full* and I have not
looked at the patch portion since it was uu'ed and I was too lazy to unpack.

| +
| +	if (rerror == NULL)
| +		rerror = &rep;
| +
| +#if defined(_KERNEL) || defined(_STANDALONE) || \
| +    defined(HAVE_NBTOOL_CONFIG_H) || defined(BCS_ONLY)
| +	im = __WRAPPED(ptr, &ep, base, lo, hi, rerror);
| +#else
| +	im = __WRAPPED_L(ptr, &ep, base, lo, hi, rerror, loc);
| +#endif
| +
| +	if (ptr == '\0' || *ep != '\0') {

This is wrong. You probably mean *ptr...

christos


Home | Main Index | Thread Index | Old Index