diff options
author | Russell Belfer <rb@github.com> | 2014-03-12 11:21:55 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-03-12 11:21:55 -0700 |
commit | 5302a88538c870028f2623b099c66c800f5cfe68 (patch) | |
tree | 473517cf5e447c8cc25e5e2430ac6d640bafb910 /src/pqueue.c | |
parent | 9af14886a94ca4d08c7af1ba84b21cba40fce34c (diff) | |
download | libgit2-5302a88538c870028f2623b099c66c800f5cfe68.tar.gz |
Fix pqueue sort boundary condition bug
If the pqueue comparison fn returned just 0 or 1 (think "a<b")
then the sort order of returned items could be wrong because there
was a "< 0" that really needed to be "<= 0". Yikes!!!
Diffstat (limited to 'src/pqueue.c')
-rw-r--r-- | src/pqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pqueue.c b/src/pqueue.c index 172cf43d5..54a60ca04 100644 --- a/src/pqueue.c +++ b/src/pqueue.c @@ -68,7 +68,7 @@ static void pqueue_down(git_pqueue *pq, size_t el) kid_el += 1; } - if (pq->_cmp(parent, kid) < 0) + if (pq->_cmp(parent, kid) <= 0) break; pq->contents[el] = kid; |