mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
treemanifest: check memcmp < 0 instead of memcmp == -1
Summary: The memcmp contract is that the result is >0, 0, or <0. If <0 it's not guaranteed to be -1, so let's broaden the check a bit. Reviewed By: phillco Differential Revision: D8190843 fbshipit-source-id: 78b864a639851a041c1a393f21a979d13eaa2e9c
This commit is contained in:
parent
2ad3a4421e
commit
06e89ef39e
@ -235,7 +235,7 @@ void Manifest::computeNode(const char *p1, const char *p2, char *result) {
|
||||
fbhg_sha1_ctx_t ctx;
|
||||
fbhg_sha1_init(&ctx);
|
||||
|
||||
if (memcmp(p1, p2, BIN_NODE_SIZE) == -1) {
|
||||
if (memcmp(p1, p2, BIN_NODE_SIZE) < 0) {
|
||||
fbhg_sha1_update(&ctx, p1, BIN_NODE_SIZE);
|
||||
fbhg_sha1_update(&ctx, p2, BIN_NODE_SIZE);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user