From dd937e32bd78f922fba7ede188e17b4d61c67d78 Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Tue, 29 Jul 2003 13:32:10 +0000 Subject: 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. --- sys/netatm/sigpvc/sigpvc_if.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sys/netatm/sigpvc') 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); } -- cgit v1.2.3