]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Update EPG sort helper functions.
authorDeltaMikeCharlie <127641886+DeltaMikeCharlie@users.noreply.github.com>
Tue, 30 Dec 2025 10:06:05 +0000 (21:06 +1100)
committerFlole <Flole998@users.noreply.github.com>
Thu, 1 Jan 2026 16:30:17 +0000 (17:30 +0100)
src/epg.c

index 720c2db549f02e01a87a6d8ebeb89c1b0c3e427e..08f24c5322b6c1858c9dff7e7707f84049814b06 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -2613,14 +2613,14 @@ static int _epg_sort_channel_num_ascending ( const void *a, const void *b, void
 {
   int64_t v1 = channel_get_number((*(epg_broadcast_t**)a)->channel);
   int64_t v2 = channel_get_number((*(epg_broadcast_t**)b)->channel);
-  return v1 - v2;
+  return (v1 > v2) - (v1 < v2);
 }
 
 static int _epg_sort_channel_num_descending ( const void *a, const void *b, void *eq )
 {
   const int64_t v1 = channel_get_number((*(epg_broadcast_t**)a)->channel);
   const int64_t v2 = channel_get_number((*(epg_broadcast_t**)b)->channel);
-  return v2 - v1;
+  return (v2 > v1) - (v2 < v1);
 }
 
 static int _epg_sort_stars_ascending ( const void *a, const void *b, void *eq )