]> git.pld-linux.org Git - packages/ntp.git/blob - ntp-4.2.4-sprintf.patch
- if 0 instead
[packages/ntp.git] / ntp-4.2.4-sprintf.patch
1 --- ntp-4.2.4/ntpd/refclock_wwv.c.sprintf       2006-12-28 13:03:49.000000000 +0100
2 +++ ntp-4.2.4/ntpd/refclock_wwv.c       2007-01-02 17:52:10.000000000 +0100
3 @@ -1364,7 +1364,7 @@
4                 else
5                         sp->metric = wwv_metric(sp);
6                 if (pp->sloppyclockflag & CLK_FLAG4) {
7 -                       sprintf(tbuf,
8 +                       snprintf(tbuf, sizeof (tbuf),
9                             "wwv8 %04x %3d %s %04x %.0f %.0f/%.1f %4ld %4ld",
10                             up->status, up->gain, sp->refid,
11                             sp->reach & 0xffff, sp->metric, sp->synmax,
12 @@ -1491,7 +1491,7 @@
13         }
14         if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status & MSYNC))
15             {
16 -               sprintf(tbuf,
17 +               snprintf(tbuf, sizeof (tbuf),
18                     "wwv1 %04x %3d %4d %5.0f %5.1f %5d %4d %4d %4d",
19                     up->status, up->gain, tepoch, up->epomax,
20                     up->eposnr, tmp2, avgcnt, syncnt,
21 @@ -1582,7 +1582,7 @@
22                 }
23         }
24         if (pp->sloppyclockflag & CLK_FLAG4) {
25 -               sprintf(tbuf,
26 +               snprintf(tbuf, sizeof (tbuf),
27                     "wwv2 %04x %5.0f %5.1f %5d %4d %4d %4d %4.0f %7.2f",
28                     up->status, up->epomax, up->eposnr, mepoch,
29                     up->avgint, maxrun, mcount - zcount, dtemp,
30 @@ -1768,7 +1768,7 @@
31         struct wwvunit *up;
32         struct chan *cp;
33         struct sync *sp, *rp;
34 -       char    tbuf[80];       /* monitor buffer */
35 +       char    tbuf[128];      /* monitor buffer */
36         int     sw, arg, nsec;
37  
38         pp = peer->procptr;
39 @@ -1869,7 +1869,7 @@
40                 }
41                 rp->metric = wwv_metric(rp);
42                 if (pp->sloppyclockflag & CLK_FLAG4) {
43 -                       sprintf(tbuf,
44 +                       snprintf(tbuf, sizeof (tbuf),
45                             "wwv5 %04x %3d %4d %.0f/%.1f %.0f/%.1f %s %04x %.0f %.0f/%.1f %s %04x %.0f %.0f/%.1f",
46                             up->status, up->gain, up->yepoch,
47                             up->epomax, up->eposnr, up->datsig,
48 @@ -2041,7 +2041,7 @@
49         }
50         if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
51             DSYNC)) {
52 -               sprintf(tbuf,
53 +               snprintf(tbuf, sizeof (tbuf),
54                     "wwv3 %2d %04x %3d %4d %5.0f %5.1f %5.0f %5.1f %5.0f",
55                     nsec, up->status, up->gain, up->yepoch, up->epomax,
56                     up->eposnr, up->datsig, up->datsnr, bit);
57 @@ -2212,7 +2212,7 @@
58         }
59         if ((pp->sloppyclockflag & CLK_FLAG4) && !(up->status &
60             INSYNC)) {
61 -               sprintf(tbuf,
62 +               snprintf(tbuf, sizeof (tbuf),
63                     "wwv4 %2d %04x %3d %4d %5.0f %2d %d %d %d %5.0f %5.1f",
64                     up->rsec - 1, up->status, up->gain, up->yepoch,
65                     up->epomax, vp->radix, vp->digit, vp->mldigit,
This page took 0.061736 seconds and 3 git commands to generate.