From f8dcc0f8ba4feb1af9536cf43741a2691eac7eee Mon Sep 17 00:00:00 2001 From: Tom Nicklin Date: Sat, 24 Mar 2018 19:02:24 +0000 Subject: [PATCH] Little fix for valgrind reports uninitialised byte(s) in bind call. --- cansend.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cansend.c b/cansend.c index ac49de3..31f6723 100644 --- a/cansend.c +++ b/cansend.c @@ -103,7 +103,7 @@ int main(int argc, char **argv) } bzero(&addr,sizeof(struct sockaddr_can)); //zero out the struct - + addr.can_family = AF_CAN; addr.can_ifindex = ifr.ifr_ifindex; @@ -137,8 +137,6 @@ int main(int argc, char **argv) /* this reason we can remove the receive list in the Kernel to save a */ /* little (really a very little!) CPU usage. */ setsockopt(s, SOL_CAN_RAW, CAN_RAW_FILTER, NULL, 0); - - // bzero(&addr,sizeof(struct sockaddr_can)); //zero out the struct if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { perror("bind");