diff options
author | harti <harti@FreeBSD.org> | 2003-11-15 15:26:35 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-11-15 15:26:35 +0000 |
commit | 91fb8e3f9c1a952bb775f1bb31ea6559b00513de (patch) | |
tree | 201c2a255c93bc25015b4e71f409755772c4c70e /usr.sbin/ppp | |
parent | 893ed3a2447f87376575889b23f244a2d8f65be6 (diff) | |
download | FreeBSD-src-91fb8e3f9c1a952bb775f1bb31ea6559b00513de.zip FreeBSD-src-91fb8e3f9c1a952bb775f1bb31ea6559b00513de.tar.gz |
Replace all uses of the old netgraph constants NG_*LEN by the new
constants NG_*SIZ that include the trailing NUL byte. This change
is mostly mechanical except for the replacement of a couple of snprintf()
and sprintf() calls with strlcpy.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/netgraph.c | 18 | ||||
-rw-r--r-- | usr.sbin/ppp/tty.c | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/ppp/netgraph.c b/usr.sbin/ppp/netgraph.c index 1ada596d..15ace22 100644 --- a/usr.sbin/ppp/netgraph.c +++ b/usr.sbin/ppp/netgraph.c @@ -91,7 +91,7 @@ struct ngdevice { struct device dev; /* What struct physical knows about */ int cs; /* Control socket */ - char hook[NG_HOOKLEN + 1]; /* Our socket node hook */ + char hook[NG_HOOKSIZ]; /* Our socket node hook */ }; #define device2ng(d) ((d)->type == NG_DEVICE ? (struct ngdevice *)d : NULL) @@ -107,7 +107,7 @@ ng_DeviceSize(void) static int ng_MessageOut(struct ngdevice *dev, struct physical *p, const char *data) { - char path[NG_PATHLEN + 1]; + char path[NG_PATHSIZ]; int len, pos, dpos; char *fmt; @@ -168,7 +168,7 @@ ng_MessageIn(struct physical *p, char *buf, size_t sz) char msgbuf[sizeof(struct ng_mesg) * 2 + NG_MSGBUFSZ]; struct ngdevice *dev = device2ng(p->handler); struct ng_mesg *rep = (struct ng_mesg *)msgbuf; - char path[NG_PATHLEN + 1]; + char path[NG_PATHSIZ]; int len; #ifdef BROKEN_SELECT @@ -232,7 +232,7 @@ ng_Write(struct physical *p, const void *v, size_t n) static ssize_t ng_Read(struct physical *p, void *v, size_t n) { - char hook[NG_HOOKLEN + 1]; + char hook[NG_HOOKSIZ]; log_Printf(LogDEBUG, "ng_Read\n"); switch (p->dl->state) { @@ -462,11 +462,11 @@ ng_Create(struct physical *p) struct ngm_mkpeer mkp; struct ngm_connect ngc; const char *devp, *endp; - char lasthook[NG_HOOKLEN + 1]; - char hook[NG_HOOKLEN + 1]; - char nodetype[NG_TYPELEN + NG_NODELEN + 2]; - char modname[NG_TYPELEN + 4]; - char path[NG_PATHLEN + 1]; + char lasthook[NG_HOOKSIZ]; + char hook[NG_HOOKSIZ]; + char nodetype[NG_TYPESIZ + NG_NODESIZ]; + char modname[NG_TYPESIZ + 3]; + char path[NG_PATHSIZ]; char *nodename; int len, sz, done, f; diff --git a/usr.sbin/ppp/tty.c b/usr.sbin/ppp/tty.c index b26bfdb..b72ec79 100644 --- a/usr.sbin/ppp/tty.c +++ b/usr.sbin/ppp/tty.c @@ -227,7 +227,7 @@ static void tty_SetAsyncParams(struct physical *p, u_int32_t mymap, u_int32_t hismap) { struct ttydevice *dev = device2tty(p->handler); - char asyncpath[NG_PATHLEN + 1]; + char asyncpath[NG_PATHSIZ]; struct ng_async_cfg cfg; if (isngtty(dev)) { @@ -256,7 +256,7 @@ LoadLineDiscipline(struct physical *p) u_char rbuf[sizeof(struct ng_mesg) + sizeof(struct nodeinfo)]; struct ng_mesg *reply; struct nodeinfo *info; - char ttypath[NG_NODELEN + 1]; + char ttypath[NG_NODESIZ]; struct ngm_mkpeer ngm; struct ngm_connect ngc; int ldisc, cs, ds, hot, speed; |