diff options
author | brian <brian@cvs.openbsd.org> | 1999-06-08 20:12:31 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-06-08 20:12:31 +0000 |
commit | 16e2072928c5fbdc50c566c87e6e6e392e99c380 (patch) | |
tree | fddff40e19b742b400a3b1d4b29d691d63de0fee /usr.sbin | |
parent | e538f87050d7c18fee2a14ab7e18e83ea544de5d (diff) |
Don't use static variables if we don't have to.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/command.c | 14 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/ipcp.c | 5 |
2 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c index 06abdae701d..1799940a59a 100644 --- a/usr.sbin/ppp/ppp/command.c +++ b/usr.sbin/ppp/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.25 1999/06/05 21:35:58 brian Exp $ + * $Id: command.c,v 1.26 1999/06/08 20:12:28 brian Exp $ * */ #include <sys/param.h> @@ -143,7 +143,7 @@ #define NEG_DNS 52 const char Version[] = "2.22"; -const char VersionDate[] = "$Date: 1999/06/05 21:35:58 $"; +const char VersionDate[] = "$Date: 1999/06/08 20:12:28 $"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); @@ -935,16 +935,20 @@ command_Run(struct bundle *bundle, int argc, char const *const *argv, { if (argc > 0) { if (log_IsKept(LogCOMMAND)) { - static char buf[LINE_LEN]; + char buf[LINE_LEN]; int f, n; - *buf = '\0'; if (label) { strncpy(buf, label, sizeof buf - 3); buf[sizeof buf - 3] = '\0'; strcat(buf, ": "); + n = strlen(buf); + } else { + *buf = '\0'; + n = 0; } - n = strlen(buf); + buf[sizeof buf - 1] = '\0'; /* In case we run out of room in buf */ + for (f = 0; f < argc; f++) { if (n < sizeof buf - 1 && f) buf[n++] = ' '; diff --git a/usr.sbin/ppp/ppp/ipcp.c b/usr.sbin/ppp/ppp/ipcp.c index 701cd21a86b..8ed43b19140 100644 --- a/usr.sbin/ppp/ppp/ipcp.c +++ b/usr.sbin/ppp/ppp/ipcp.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: ipcp.c,v 1.16 1999/06/08 11:59:00 brian Exp $ + * $Id: ipcp.c,v 1.17 1999/06/08 20:12:30 brian Exp $ * * TODO: * o Support IPADDRS properly @@ -504,8 +504,7 @@ static int ipcp_SetIPaddress(struct bundle *bundle, struct in_addr myaddr, struct in_addr hisaddr, int silent) { - static struct in_addr none = { INADDR_ANY }; - struct in_addr mask, oaddr; + struct in_addr mask, oaddr, none = { INADDR_ANY }; mask = addr2mask(myaddr); |