summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-06-08 20:12:06 +0000
committerbrian <brian@FreeBSD.org>1999-06-08 20:12:06 +0000
commitb5ed987df095feb40573ae128ef77174046ba3be (patch)
treeb8d8afe8320e5ad0af8f9876993024e727a90c44 /usr.sbin/ppp
parent9ba53ba0dd584dd97151aab88c60e87cc4776f61 (diff)
downloadFreeBSD-src-b5ed987df095feb40573ae128ef77174046ba3be.zip
FreeBSD-src-b5ed987df095feb40573ae128ef77174046ba3be.tar.gz
Don't use static variables if we don't have to.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/command.c14
-rw-r--r--usr.sbin/ppp/ipcp.c5
2 files changed, 11 insertions, 8 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 390c4f6..1820615 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/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.197 1999/06/02 21:28:02 brian Exp $
+ * $Id: command.c,v 1.198 1999/06/05 21:35:48 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/02 21:28:02 $";
+const char VersionDate[] = "$Date: 1999/06/05 21:35:48 $";
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/ipcp.c b/usr.sbin/ppp/ipcp.c
index 768ef9b..f1b0ddd 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/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.79 1999/06/02 15:59:01 brian Exp $
+ * $Id: ipcp.c,v 1.80 1999/06/08 11:58:27 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);
OpenPOWER on IntegriCloud