summaryrefslogtreecommitdiffstats
path: root/usr.sbin/xntpd
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-08-20 01:24:35 +0000
committermdodd <mdodd@FreeBSD.org>1999-08-20 01:24:35 +0000
commitadd3f6325f928a3acb756b34b7018942f7cfdbd7 (patch)
tree24613bef7b6a7a588e0ea9bee3aa1b944b0cc8d2 /usr.sbin/xntpd
parentb47bf1ab5f378718e3afceba062ddbe540147e75 (diff)
downloadFreeBSD-src-add3f6325f928a3acb756b34b7018942f7cfdbd7.zip
FreeBSD-src-add3f6325f928a3acb756b34b7018942f7cfdbd7.tar.gz
What the heck was I thinking? Nobody else saw this? Sheesh.
(num > MAX) ? MAX : num rather than (MAX > num) ? MAX : num Also, make things a little easier to read while I'm here.
Diffstat (limited to 'usr.sbin/xntpd')
-rw-r--r--usr.sbin/xntpd/xntpdc/ntpdc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/xntpd/xntpdc/ntpdc.c b/usr.sbin/xntpd/xntpdc/ntpdc.c
index 9897695..de4c342 100644
--- a/usr.sbin/xntpd/xntpdc/ntpdc.c
+++ b/usr.sbin/xntpd/xntpdc/ntpdc.c
@@ -808,6 +808,7 @@ getcmds()
static History *hist = NULL;
char line[MAXLINE];
int num = 0;
+ int len;
const char *bp = NULL;
for (;;) {
@@ -825,8 +826,9 @@ getcmds()
if ((bp = el_gets(el, &num)) == NULL || num == 0)
return;
- memcpy(line, bp, (MAXLINE > num ? MAXLINE : num));
- line[num] = 0;
+ len = (num > MAX_CMDLINE) ? MAX_CMDLINE : num);
+ memcpy(line, bp, len);
+ line[len] = 0;
history(hist, H_ENTER, bp);
} else {
OpenPOWER on IntegriCloud