Skip to content

Commit c71567d

Browse files
committed
fix: Pass array, not array pointer, to memcmp.
The types were incompatible.
1 parent 9b46a08 commit c71567d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

toxcore/group_announce.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ int gca_get_announces(const GC_Announces_List *gc_announces_list, GC_Announce *g
7878
for (size_t i = 0; i < announces->index && i < GCA_MAX_SAVED_ANNOUNCES_PER_GC && added_count < max_nodes; ++i) {
7979
const size_t index = i % GCA_MAX_SAVED_ANNOUNCES_PER_GC;
8080

81-
if (memcmp(except_public_key, &announces->peer_announces[index].base_announce.peer_public_key,
81+
if (memcmp(except_public_key, announces->peer_announces[index].base_announce.peer_public_key,
8282
ENC_PUBLIC_KEY_SIZE) == 0) {
8383
continue;
8484
}
8585

8686
bool already_added = false;
8787

8888
for (size_t j = 0; j < added_count; ++j) {
89-
if (memcmp(&gc_announces[j].peer_public_key, &announces->peer_announces[index].base_announce.peer_public_key,
89+
if (memcmp(gc_announces[j].peer_public_key, announces->peer_announces[index].base_announce.peer_public_key,
9090
ENC_PUBLIC_KEY_SIZE) == 0) {
9191
already_added = true;
9292
break;

0 commit comments

Comments
 (0)