Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/ntp/dist/ntpd fix some fallout from append corr...
details: https://anonhg.NetBSD.org/src/rev/7c88e0667484
branches: trunk
changeset: 780922:7c88e0667484
user: kardel <kardel%NetBSD.org@localhost>
date: Sat Aug 11 20:09:08 2012 +0000
description:
fix some fallout from append correction
diffstat:
external/bsd/ntp/dist/ntpd/refclock_parse.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diffs (61 lines):
diff -r 655fa1301dd6 -r 7c88e0667484 external/bsd/ntp/dist/ntpd/refclock_parse.c
--- a/external/bsd/ntp/dist/ntpd/refclock_parse.c Sat Aug 11 17:03:26 2012 +0000
+++ b/external/bsd/ntp/dist/ntpd/refclock_parse.c Sat Aug 11 20:09:08 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: refclock_parse.c,v 1.6 2012/08/10 08:22:49 christos Exp $ */
+/* $NetBSD: refclock_parse.c,v 1.7 2012/08/11 20:09:08 kardel Exp $ */
/*
* /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -3527,7 +3527,9 @@
tmpctl.parsegettc.parse_state |= parse->timedata.parse_state &
(PARSEB_PPS|PARSEB_S_PPS);
- (void) parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));
+ (void)parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));
+
+ tt += strlen(tt);
tt = ap(start, 512, tt, "\"");
@@ -3546,13 +3548,18 @@
}
else
{
+ int count = tmpctl.parseformat.parse_count - 1;
+
start = tt = add_var(&out->kv_list, 80, RO|DEF);
tt = ap(start, 80, tt, "refclock_format=\"");
- tt = ap(start, 80, tt, "*.*s",
- tmpctl.parseformat.parse_count,
- tmpctl.parseformat.parse_count,
- tmpctl.parseformat.parse_buffer);
+ if (count > 0) {
+ tt = ap(start, 80, tt, "%*.*s",
+ count,
+ count,
+ tmpctl.parseformat.parse_buffer);
+ }
+
tt = ap(start, 80, tt, "\"");
}
@@ -4535,8 +4542,8 @@
if (utc.valid)
{
p = ap(buffer, sizeof(buffer), p, "gps_utc_correction=\"");
+ mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt, utc.delta_tls, utc.delta_tlsf, BUFFER_SIZE(buffer, p));
p += strlen(p);
- mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt, utc.delta_tls, utc.delta_tlsf, BUFFER_SIZE(buffer, p));
p = ap(buffer, sizeof(buffer), p, "\"");
}
else
@@ -5457,7 +5464,6 @@
t = ap(pbuffer, sizeof(pbuffer), t, "-MANUAL, ");
else
t = ap(pbuffer, sizeof(pbuffer), t, "-AUTO, ");
- t += strlen(t);
t = ap(pbuffer, sizeof(pbuffer), t, "satellites %02d %02d %02d %02d, PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f",
mb(1), mb(2), mb(3), mb(4),
Home |
Main Index |
Thread Index |
Old Index