Commit 38e3c5f0 authored by Sven Eckelmann's avatar Sven Eckelmann

batman-adv: Don't do pointer arithmetic with void*

The size of void is currently set by gcc to 1, but is not well defined
in general. Therefore it is more advisable to cast it to char* before
doing pointer arithmetic.
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 16f14b45
...@@ -559,7 +559,7 @@ static int orig_node_del_if(struct orig_node *orig_node, ...@@ -559,7 +559,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size); memcpy(data_ptr, orig_node->bcast_own, del_if_num * chunk_size);
/* copy second part */ /* copy second part */
memcpy(data_ptr + del_if_num * chunk_size, memcpy((char *)data_ptr + del_if_num * chunk_size,
orig_node->bcast_own + ((del_if_num + 1) * chunk_size), orig_node->bcast_own + ((del_if_num + 1) * chunk_size),
(max_if_num - del_if_num) * chunk_size); (max_if_num - del_if_num) * chunk_size);
...@@ -579,7 +579,7 @@ static int orig_node_del_if(struct orig_node *orig_node, ...@@ -579,7 +579,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
memcpy(data_ptr, orig_node->bcast_own_sum, memcpy(data_ptr, orig_node->bcast_own_sum,
del_if_num * sizeof(uint8_t)); del_if_num * sizeof(uint8_t));
memcpy(data_ptr + del_if_num * sizeof(uint8_t), memcpy((char *)data_ptr + del_if_num * sizeof(uint8_t),
orig_node->bcast_own_sum + ((del_if_num + 1) * sizeof(uint8_t)), orig_node->bcast_own_sum + ((del_if_num + 1) * sizeof(uint8_t)),
(max_if_num - del_if_num) * sizeof(uint8_t)); (max_if_num - del_if_num) * sizeof(uint8_t));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment