diff options
author | harti <harti@FreeBSD.org> | 2004-01-26 14:57:49 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-01-26 14:57:49 +0000 |
commit | 7ce7ecdff6a94c18c2c9e30b1348c73f3e3a6175 (patch) | |
tree | bba00c22b24f1bb8b6ba2c250f632c22397a53c3 /sys/netgraph | |
parent | c4f8c33a9a3e15f4defd14c68239ba9df07e499d (diff) | |
download | FreeBSD-src-7ce7ecdff6a94c18c2c9e30b1348c73f3e3a6175.zip FreeBSD-src-7ce7ecdff6a94c18c2c9e30b1348c73f3e3a6175.tar.gz |
Get rid of the old *LEN constants in favour of the new *SIZ constants
that also include the trailing \0 byte.
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/atm/ng_atm.c | 8 | ||||
-rw-r--r-- | sys/netgraph/atm/ng_atm.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/netgraph/atm/ng_atm.c b/sys/netgraph/atm/ng_atm.c index f1afeb1..1750cdd 100644 --- a/sys/netgraph/atm/ng_atm.c +++ b/sys/netgraph/atm/ng_atm.c @@ -991,7 +991,7 @@ ng_atm_rcvmsg(node_p node, item_p item, hook_p lasthook) case NGM_ATM_GET_VCC: { - char hook[NG_HOOKLEN + 1]; + char hook[NG_HOOKSIZ]; struct atmio_vcctable *vccs; struct ngvcc *vcc; u_int i; @@ -1000,12 +1000,12 @@ ng_atm_rcvmsg(node_p node, item_p item, hook_p lasthook) error = ENXIO; break; } - if (msg->header.arglen != NG_HOOKLEN + 1) { + if (msg->header.arglen != NG_HOOKSIZ) { error = EINVAL; break; } - strncpy(hook, msg->data, NG_HOOKLEN + 1); - hook[NG_HOOKLEN] = '\0'; + strncpy(hook, msg->data, NG_HOOKSIZ); + hook[NG_HOOKSIZ - 1] = '\0'; LIST_FOREACH(vcc, &priv->vccs, link) if (strcmp(NG_HOOK_NAME(vcc->hook), hook) == 0) break; diff --git a/sys/netgraph/atm/ng_atm.h b/sys/netgraph/atm/ng_atm.h index 675b437..ebf7cb6 100644 --- a/sys/netgraph/atm/ng_atm.h +++ b/sys/netgraph/atm/ng_atm.h @@ -126,7 +126,7 @@ struct ngm_atm_config { * Structure to open a VCC. */ struct ngm_atm_cpcs_init { - char name[NG_HOOKLEN + 1]; + char name[NG_HOOKSIZ]; uint32_t flags; /* flags. (if_atm.h) */ uint16_t vci; /* VCI to open */ uint16_t vpi; /* VPI to open */ @@ -177,7 +177,7 @@ struct ngm_atm_cpcs_init { * Structure to close a VCI without disconnecting the hook */ struct ngm_atm_cpcs_term { - char name[NG_HOOKLEN + 1]; + char name[NG_HOOKSIZ]; }; #define NGM_ATM_CPCS_TERM_INFO \ { \ |