]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
refclock_acts.c cleanup from Dave Mills
authorHarlan Stenn <stenn@ntp.org>
Mon, 21 Feb 2011 04:11:05 +0000 (23:11 -0500)
committerHarlan Stenn <stenn@ntp.org>
Mon, 21 Feb 2011 04:11:05 +0000 (23:11 -0500)
bk: 4d61e5d9A_2dpikJKImLr8k9qFLIDA

ChangeLog
ntpd/refclock_acts.c

index ac7d831aee712a784a0b66939f1f22929a292a68..57e16dad01758313d30b698645e2e3fc48ef30e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* refclock_acts.c cleanup from Dave Mills.
 (4.2.7p130) 2011/02/12 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 1811] Update the download location in WHERE-TO-START.
 (4.2.7p129) 2011/02/09 Released by Harlan Stenn <stenn@ntp.org>
index ac1b2616137e5270b4a5672c5f83850ba6323c13..296ee80e32ea1ea2c85bf2e88a02480513111133 100644 (file)
@@ -165,7 +165,8 @@ extern int async_write(int, const void *, unsigned int);
 #define LF             0x0a    /* ASCII LF */
 
 /*
- * Modem setup strings. These may have to be changed for some modems.
+ * Modem setup strings. These may have to be changed for
+ * some modems.
  *
  * AT  command prefix
  * B1  US answer tone
@@ -381,7 +382,7 @@ acts_message(
        /*
         * Extract the first token in the line.
         */
-       strncpy(tbuf, msg, sizeof(tbuf));
+       strncpy(tbuf, msg, sizeof(tbuf) - 1);
        strtok(tbuf, " ");
        switch (up->state) {
 
@@ -895,7 +896,7 @@ acts_timecode(
        if (up->msgcnt == 0)
                return;
 
-       strncpy(pp->a_lastcode, str, sizeof(pp->a_lastcode));
+       strncpy(pp->a_lastcode, str, sizeof(pp->a_lastcode) - 1);
        pp->lencode = strlen(pp->a_lastcode);
        if (!refclock_process(pp)) {
                refclock_report(peer, CEVNT_BADTIME);