diff options
author | Hartmut Brandt <harti@FreeBSD.org> | 2003-07-29 13:32:10 +0000 |
---|---|---|
committer | Hartmut Brandt <harti@FreeBSD.org> | 2003-07-29 13:32:10 +0000 |
commit | dd937e32bd78f922fba7ede188e17b4d61c67d78 (patch) | |
tree | 676fa306ffbf8bb59c756cf9a9bb95f16ae21cd4 /sys/netatm/sigpvc | |
parent | da2f008200f3b2a4c26e19b0bbf84d86b78577a1 (diff) |
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.
Notes
Notes:
svn path=/head/; revision=118160
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 dbcc215e5088..8fab9b702fd2 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); } |