Signed-off-by: MORITA Kazutaka <[email protected]>
---
 sheep/farm/trunk.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/sheep/farm/trunk.c b/sheep/farm/trunk.c
index cd1fd20..8a53f9f 100644
--- a/sheep/farm/trunk.c
+++ b/sheep/farm/trunk.c
@@ -169,7 +169,9 @@ out:
 
 static inline int trunk_entry_no_sha1(struct trunk_entry_incore *entry)
 {
-       return !strlen((char *)entry->raw.sha1);
+       unsigned char empty[SHA1_LEN] = {0};
+
+       return memcmp(entry->raw.sha1, empty, SHA1_LEN) == 0;
 }
 
 static inline void put_entry(struct trunk_entry_incore *entry)
-- 
1.7.2.5

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to