synk

synchronize files between hosts
Log | Files | Refs | README | LICENSE

commit e88965f27c0b666e672353ad1a79558fe0f86f6b
parent b59800dbb6e6361dfe8e2597b3585450d8763509
Author: Willy <willyatmailoodotorg>
Date:   Fri Sep  2 01:07:48 +0200

Fix sha512_compare() to use a referent peer

Diffstat:
synk.c | 12++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/synk.c b/synk.c @@ -332,16 +332,12 @@ flushpeers(struct peers_t *plist) int uptodate(struct peers_t *plist) { - struct peer_t *tmp = NULL; - unsigned char *hash = NULL; + struct peer_t *tmp, *ref; + ref = SLIST_FIRST(plist); SLIST_FOREACH(tmp, plist, entries) { - if (hash == NULL) { - hash = tmp->meta.hash; - } else { - if (!sha512_compare(hash, tmp->meta.hash)) - return 0; - } + if (!sha512_compare(ref->meta.hash, tmp->meta.hash)) + return 0; } return 1;