From: Harlan Stenn Date: Mon, 21 Feb 2011 04:11:05 +0000 (-0500) Subject: refclock_acts.c cleanup from Dave Mills X-Git-Tag: NTP_4_2_7P131~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3832871eaa9d2d9e365215d4160ee37921196216;p=thirdparty%2Fntp.git refclock_acts.c cleanup from Dave Mills bk: 4d61e5d9A_2dpikJKImLr8k9qFLIDA --- diff --git a/ChangeLog b/ChangeLog index ac7d831ae..57e16dad0 100644 --- 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 * [Bug 1811] Update the download location in WHERE-TO-START. (4.2.7p129) 2011/02/09 Released by Harlan Stenn diff --git a/ntpd/refclock_acts.c b/ntpd/refclock_acts.c index ac1b26161..296ee80e3 100644 --- a/ntpd/refclock_acts.c +++ b/ntpd/refclock_acts.c @@ -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);