summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/command.c
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/command.c
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/command.c')
-rw-r--r--usr.sbin/ppp/command.c14
1 files changed, 9 insertions, 5 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++] = ' ';
OpenPOWER on IntegriCloud