@pmatilai commented on this pull request.


> @@ -726,16 +727,37 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, 
> const char *cookie, int ch
     return rc;
 }
 
+static int compareBinaries(const void *p1, const void *p2) {
+    Package pkg1 = *(Package *)p1;
+    Package pkg2 = *(Package *)p2;
+    uint64_t size1 = headerGetNumber(pkg1->header, RPMTAG_SIZE);
+    uint64_t size2 = headerGetNumber(pkg2->header, RPMTAG_SIZE);
+    return size1 - size2;

The difference between two 64bit integers can overflow the 32bit int return 
code, you'll want to normalize the return one way or the other.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1180#pullrequestreview-393544857
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to