diff options
author | harti <harti@FreeBSD.org> | 2003-07-29 13:32:10 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-07-29 13:32:10 +0000 |
commit | e57d86c1ec38c63f22ddae8025c1dbc035586faa (patch) | |
tree | 676fa306ffbf8bb59c756cf9a9bb95f16ae21cd4 /sys/netatm/sigpvc | |
parent | 0b9b67134272377bf22b1b9f1092a5da3d74f251 (diff) | |
download | FreeBSD-src-e57d86c1ec38c63f22ddae8025c1dbc035586faa.zip FreeBSD-src-e57d86c1ec38c63f22ddae8025c1dbc035586faa.tar.gz |
Make the ioctl() interface cleaner with regard to types: use size_t
instead of int where the variable has to hold buffer lengths,
use u_int for things like number of network interfaces which
in principle can never be negative.
Diffstat (limited to 'sys/netatm/sigpvc')
-rw-r--r-- | sys/netatm/sigpvc/sigpvc_if.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netatm/sigpvc/sigpvc_if.c b/sys/netatm/sigpvc/sigpvc_if.c index dbcc215..8fab9b7 100644 --- a/sys/netatm/sigpvc/sigpvc_if.c +++ b/sys/netatm/sigpvc/sigpvc_if.c @@ -555,9 +555,11 @@ sigpvc_ioctl(code, data, arg1) Atm_connection *cop; caddr_t cp; u_int vpi, vci; - int i, space, err = 0; - + int err; + size_t space; + size_t tlen; + err = 0; switch (code) { case AIOCS_DEL_PVC: @@ -633,10 +635,10 @@ sigpvc_ioctl(code, data, arg1) else avr.avp_encaps = 0; bzero(avr.avp_owners, sizeof(avr.avp_owners)); - for (i = 0; cop && i < sizeof(avr.avp_owners); + for (tlen = 0; cop && tlen < sizeof(avr.avp_owners); cop = cop->co_next, - i += T_ATM_APP_NAME_LEN+1) { - strncpy(&avr.avp_owners[i], + tlen += T_ATM_APP_NAME_LEN + 1) { + strncpy(&avr.avp_owners[tlen], cop->co_endpt->ep_getname(cop->co_toku), T_ATM_APP_NAME_LEN); } |