This fixes valgrind errors.
Signed-off-by: Miroslav Lichvar <[email protected]>
---
sysoff.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sysoff.c b/sysoff.c
index f7b6240..407a01c 100644
--- a/sysoff.c
+++ b/sysoff.c
@@ -18,6 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
+#include <string.h>
#include <sys/ioctl.h>
#include <linux/ptp_clock.h>
@@ -76,6 +77,7 @@ int sysoff_measure(int fd, int n_samples,
int64_t *result, uint64_t *ts, int64_t *delay)
{
struct ptp_sys_offset pso;
+ memset(&pso, 0, sizeof(pso));
pso.n_samples = n_samples;
if (ioctl(fd, PTP_SYS_OFFSET, &pso)) {
perror("ioctl PTP_SYS_OFFSET");
--
2.17.2
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel