Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

(no subject)

From: Richard Guy Briggs <rgb(at)conscoop.ottawa.on.ca>
Date: Wed Jul 29 1998 - 15:24:51 EDT


-----BEGIN PGP SIGNED MESSAGE----- Can the manpage of atosubnet be updated which explicitly states that the return values are 0 for success and -1 for failure, when in fact it returns the number of bytes required to write the address. I just spent a couple of hours trying to figure out why eroute has been failing, when in fact it thought it had succeeded (I mucked up one of the strcpy's and didn't regress).

Here is the mod to addrtoa.c:
#if 0

                strcpy(dst, buf);

#else
for(i = 0; (i < dstlen) && (i < n); i++) { dst[i]=buf[i]; }

#endif

Here is the mod to ultoa.c:
#if 0

                strcpy(dst, p);

#else
for(i = 0; (i < dstlen) && (i < len); i++) { dst[i]=p[i]; }

#endif

I mucked it up because the variable 'n' was not used consistently between the source modules.

Instead of using #if 0 to eliminate it, perhaps we could use:
#ifndef __KERNEL__

The other change is in datatoa.c:

        case 2:
/*              strcpy(dst, "0"); */
/*              dst += 1; */
                *dst++ = '0';
                *dst = '\0';
                break;
        default:
/*              strcpy(dst, "0x"); */
/*              dst += 2; */
                *dst++ = '0';
                *dst++ = 'x';
                *dst = '\0';
                break;

In some ways, I prefer this, as then nobody will forget to update the 'dst +=' line.

Obviously, the regression tests did not need to have strcpy changed.

Do you need help?X

I have some stuff to check in...

        slainte mhath, RGB
- --

Richard Guy Briggs -- PGP key available                       Auto-Free Ottawa!
rgb at conscoop dot ottawa dot on dot ca              
http://www.flora.org/afo/http://www.achilles.net/~rgb/                   Ottawa-Rideau Bioregion, Canada
Please send all spam to root@127.0.0.1

"We left our footprints in the Earth
And punched a hole right through the sky" -- S.Hogarth/J.Helmer(Marillion)

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBNb93Ad+sBuIhFagtAQGePgP/bdVZTSnNaHGVj9Nx1SigRAOl+YznqokJ jTwxonbKrimxoa5N/YM54Do+XqRcLaypiNq4TaaMMl26ijz9gHUZvftFtJqRS2J4 0UGfvdJpsr6c7V2wR3c+O3M1OocTSuQk5/jS+C8lQULT8zl4tCAw2vvTV2ThDDun np0+W+9eOSI=
=eqPl
-----END PGP SIGNATURE----- Received on Wed Jul 29 18:11:29 1998

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 12:59:25 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library