1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

s3: Slight reshaping of server_exists_parse

Doing a copy and then do the compare is a bit pointless, use memcmp
This commit is contained in:
Volker Lendecke 2010-07-04 14:35:05 +02:00
parent f8e7077d5c
commit 34558ae945

View File

@ -183,10 +183,12 @@ static int server_exists_parse(TDB_DATA key, TDB_DATA data, void *priv)
return -1;
}
/* memcpy, data.dptr might not be aligned */
memcpy(&unique_id, data.dptr, sizeof(unique_id));
state->exists = (state->id->unique_id == unique_id);
/*
* Use memcmp, not direct compare. data.dptr might not be
* aligned.
*/
state->exists =
(memcmp(&unique_id, data.dptr, sizeof(unique_id)) == 0);
return 0;
}