From: Matthias Clasen Date: Fri, 3 Sep 2010 23:03:34 +0000 (-0400) Subject: Sort extensions properly X-Git-Tag: 2.25.16~116 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e5532ec51e7091656f2853895cee3dc69f8ad5e;p=platform%2Fupstream%2Fglib.git Sort extensions properly Just taking the difference of the priorities has overflow issues, as pointed out in bug 623069. --- diff --git a/gio/giomodule.c b/gio/giomodule.c index 39a38ff53..83f4cc788 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -791,7 +791,13 @@ extension_prio_compare (gconstpointer a, { const GIOExtension *extension_a = a, *extension_b = b; - return extension_b->priority - extension_a->priority; + if (extension_a->priority > extension_b->priority) + return -1; + + if (extension_b->priority > extension_a->priority) + return 1; + + return 0; } /**