Fix for 64 bit platforms. sysctl's length args are pointers to

size_t, not int.  This could be fatal where size_t is long.

Reviewed by:	bp
This commit is contained in:
peter 2003-07-25 19:17:46 +00:00
parent bc3b454720
commit 823c05fbc4
2 changed files with 6 additions and 3 deletions

View File

@ -274,7 +274,8 @@ ncp_li_check(struct ncp_conn_loginfo *li) {
int
ncp_conn_cnt(void) {
int error, cnt = 0, len = sizeof(cnt);
int error, cnt = 0;
size_t len = sizeof(cnt);
error = sysctlbyname("net.ncp.conn_cnt", &cnt, &len, NULL, 0);
if (error) cnt = 0;
@ -382,7 +383,8 @@ ncp_li_arg(struct ncp_conn_loginfo *li, int opt, char *arg) {
void *
ncp_conn_list(void) {
int error, cnt = 0, len;
int error, cnt = 0;
size_t len;
void *p;
cnt = ncp_conn_cnt();

View File

@ -243,7 +243,8 @@ NWRequest(NWCONN_HANDLE cH, nuint16 fn,
int
ncp_initlib(void){
int error;
int kv, kvlen = sizeof(kv);
int kv;
size_t kvlen = sizeof(kv);
static int ncp_initialized;
if (ncp_initialized)