summaryrefslogtreecommitdiffstats
path: root/ntpd/refclock_pcf.c
diff options
context:
space:
mode:
Diffstat (limited to 'ntpd/refclock_pcf.c')
-rw-r--r--ntpd/refclock_pcf.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ntpd/refclock_pcf.c b/ntpd/refclock_pcf.c
index d4e9fd1..fcc12be 100644
--- a/ntpd/refclock_pcf.c
+++ b/ntpd/refclock_pcf.c
@@ -38,9 +38,9 @@
/*
* Function prototypes
*/
-static int pcf_start P((int, struct peer *));
-static void pcf_shutdown P((int, struct peer *));
-static void pcf_poll P((int, struct peer *));
+static int pcf_start (int, struct peer *);
+static void pcf_shutdown (int, struct peer *);
+static void pcf_poll (int, struct peer *);
/*
* Transfer vector
@@ -72,10 +72,10 @@ pcf_start(
/*
* Open device file for reading.
*/
- (void)sprintf(device, DEVICE, unit);
+ snprintf(device, sizeof(device), DEVICE, unit);
fd = open(device, O_RDONLY);
if (fd == -1) {
- (void)sprintf(device, OLDDEVICE, unit);
+ snprintf(device, sizeof(device), OLDDEVICE, unit);
fd = open(device, O_RDONLY);
}
#ifdef DEBUG
@@ -144,6 +144,8 @@ pcf_poll(
return;
}
+ memset(&tm, 0, sizeof(tm));
+
tm.tm_mday = buf[11] * 10 + buf[10];
tm.tm_mon = buf[13] * 10 + buf[12] - 1;
tm.tm_year = buf[15] * 10 + buf[14];
OpenPOWER on IntegriCloud