+ WARNS=4 reminds that nlist.n_name isn't const.

+ Use C99 initializers to be WARNS-clean.
+ The last element in a namelist should have its n_name set to NULL,
  not to an empty string.
This commit is contained in:
yar 2006-11-27 17:24:36 +00:00
parent 23e0bb44c9
commit cf3ea4f2b8

View File

@ -146,12 +146,14 @@ static const char *miblist[] = {
"net.inet.udp.pcblist"
};
static char tcb[] = "tcb", udb[] = "udb";
struct nlist namelist[] = {
#define X_TCB 0
{ "tcb" },
{ .n_name = tcb },
#define X_UDB 1
{ "udb" },
{ "" },
{ .n_name = udb },
{ .n_name = NULL },
};
int