Get rid of the old *LEN constants in favour of the new *SIZ constants

that also include the trailing \0 byte.
This commit is contained in:
Hartmut Brandt 2004-01-26 14:57:49 +00:00
parent 46005fe0eb
commit 211326affc
2 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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 \
{ \