]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_proto.c sprintf() -> snprintf()
authorDave Hart <hart@ntp.org>
Wed, 13 Apr 2011 02:22:24 +0000 (02:22 +0000)
committerDave Hart <hart@ntp.org>
Wed, 13 Apr 2011 02:22:24 +0000 (02:22 +0000)
bk: 4da508e0vtHRNUBDB-lkZJ9S6Ff5Yg

ChangeLog
ntpd/ntp_proto.c

index 4187237d7e21c9e2d237f2d729ba4a01373c418b..7391c6bc40c5e8853f0285fa6f1d83676cb6b39d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +3,7 @@
   replacements (http://www.jhweiss.de/software/snprintf.html)
 * Remove remaining sprintf() calls except refclock_ripencc.c (which is
   kept out of --enable-all-clocks as a result), upstream libs which use
-  sprintf() ony after careful buffer sizing, and ntp_proto.c.
+  sprintf() only after careful buffer sizing.
 (4.2.7p149) 2011/04/11 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 1881] describe the {+,-,s} characters in configure --help output.
 (4.2.7p148) 2011/04/09 Released by Harlan Stenn <stenn@ntp.org>
index 77e1ef43347fc656f4a75b4dd6c3e8141059ed3f..978d0e4678d9f6c4a814d16bc7d7f6b9fed0c488 100644 (file)
@@ -1573,7 +1573,8 @@ process_packet(
                p_del = t21 - t34;
                p_offset = (t21 + t34) / 2.;
                if (p_del < 0 || p_del > 1.) {
-                       sprintf(statstr, "t21 %.6f t34 %.6f", t21, t34);
+                       snprintf(statstr, sizeof(statstr),
+                           "t21 %.6f t34 %.6f", t21, t34);
                        report_event(PEVNT_XERR, peer, statstr);
                        return;
                }
@@ -1597,7 +1598,7 @@ process_packet(
                        peer->aorg = p_xmt;
                        peer->borg = peer->dst;
                        if (t34 < 0 || t34 > 1.) {
-                               sprintf(statstr,
+                               snprintf(statstr, sizeof(statstr),
                                    "offset %.6f delay %.6f", t21, t34);
                                report_event(PEVNT_XERR, peer, statstr);
                                return;