Change two variables to size_t to improve portability.
Submitted by: Xin Li
This commit is contained in:
parent
d219022c4c
commit
05b0fdac8c
@ -4964,11 +4964,12 @@ chkarg:
|
|||||||
case TOK_SETFIB:
|
case TOK_SETFIB:
|
||||||
{
|
{
|
||||||
int numfibs;
|
int numfibs;
|
||||||
|
size_t intsize = sizeof(int);
|
||||||
|
|
||||||
action->opcode = O_SETFIB;
|
action->opcode = O_SETFIB;
|
||||||
NEED1("missing fib number");
|
NEED1("missing fib number");
|
||||||
action->arg1 = strtoul(*av, NULL, 10);
|
action->arg1 = strtoul(*av, NULL, 10);
|
||||||
if (sysctlbyname("net.fibs", &numfibs, &i, NULL, 0) == -1)
|
if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
|
||||||
errx(EX_DATAERR, "fibs not suported.\n");
|
errx(EX_DATAERR, "fibs not suported.\n");
|
||||||
if (action->arg1 >= numfibs) /* Temporary */
|
if (action->arg1 >= numfibs) /* Temporary */
|
||||||
errx(EX_DATAERR, "fib too large.\n");
|
errx(EX_DATAERR, "fib too large.\n");
|
||||||
|
@ -50,7 +50,7 @@ main(int argc, char *argv[])
|
|||||||
int ch;
|
int ch;
|
||||||
char *ep;
|
char *ep;
|
||||||
int numfibs;
|
int numfibs;
|
||||||
int intsize = sizeof(int);
|
size_t intsize = sizeof(int);
|
||||||
|
|
||||||
if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
|
if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
|
||||||
errx(1, "Multiple FIBS not supported");
|
errx(1, "Multiple FIBS not supported");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user