From 173237aab3267754048a84a6b70fb2a52e6e4dc3 Mon Sep 17 00:00:00 2001 From: harti Date: Wed, 12 Nov 2003 13:04:44 +0000 Subject: Get rid of the old constants which did not include the trailing NUL and use the new constants which do. --- usr.sbin/ngctl/list.c | 2 +- usr.sbin/ngctl/main.c | 4 ++-- usr.sbin/ngctl/msg.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/ngctl/list.c b/usr.sbin/ngctl/list.c index aeb74fb..93e1024 100644 --- a/usr.sbin/ngctl/list.c +++ b/usr.sbin/ngctl/list.c @@ -99,7 +99,7 @@ ListCmd(int ac, char **av) printf("There are %d total %snodes:\n", nlist->numnames, named_only ? "named " : ""); for (k = 0; k < nlist->numnames; k++) { - char path[NG_PATHLEN+1]; + char path[NG_PATHSIZ]; char *av[3] = { "list", "-n", path }; snprintf(path, sizeof(path), diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c index 109ac17..06010cf 100644 --- a/usr.sbin/ngctl/main.c +++ b/usr.sbin/ngctl/main.c @@ -110,7 +110,7 @@ int csock, dsock; int main(int ac, char *av[]) { - char name[NG_NODELEN + 1]; + char name[NG_NODESIZ]; int interactive = isatty(0) && isatty(1); FILE *fp = NULL; int ch, rtn = 0; @@ -236,7 +236,7 @@ DoInteractive(void) /* Display any incoming data packet */ if (FD_ISSET(dsock, &rfds)) { u_char buf[8192]; - char hook[NG_HOOKLEN + 1]; + char hook[NG_HOOKSIZ]; int rl; /* Read packet from socket */ diff --git a/usr.sbin/ngctl/msg.c b/usr.sbin/ngctl/msg.c index 4ae5171..50843ae 100644 --- a/usr.sbin/ngctl/msg.c +++ b/usr.sbin/ngctl/msg.c @@ -112,7 +112,7 @@ MsgRead() u_char buf[2 * sizeof(struct ng_mesg) + BUF_SIZE]; struct ng_mesg *const m = (struct ng_mesg *)buf; struct ng_mesg *const ascii = (struct ng_mesg *)m->data; - char path[NG_PATHLEN+1]; + char path[NG_PATHSIZ]; /* Get incoming message (in binary form) */ if (NgRecvMsg(csock, m, sizeof(buf), path) < 0) { -- cgit v1.1