diff options
author | rbuj <[email protected]> | 2021-12-19 23:34:14 +0100 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-02-09 04:03:59 +0000 |
commit | b6d46039be75bd2b868ee6c32b091a1e37720a20 (patch) | |
tree | fe11a75d22da7ca239204f000c33b2338cc07419 /src/caja-places-sidebar.c | |
parent | 97b61e663e47e6bd6ee6ff460895a7370b3c6159 (diff) | |
download | caja-b6d46039be75bd2b868ee6c32b091a1e37720a20.tar.bz2 caja-b6d46039be75bd2b868ee6c32b091a1e37720a20.tar.xz |
Fix some -Wsign-compare warnings
Diffstat (limited to 'src/caja-places-sidebar.c')
-rw-r--r-- | src/caja-places-sidebar.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index 2cd22148..d0ef6ee8 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -1461,6 +1461,7 @@ reorder_bookmarks (CajaPlacesSidebar *sidebar, GtkTreeIter iter; PlaceType type; int old_position; + guint list_length; /* Get the selected path */ @@ -1472,12 +1473,12 @@ reorder_bookmarks (CajaPlacesSidebar *sidebar, PLACES_SIDEBAR_COLUMN_INDEX, &old_position, -1); - if (type != PLACES_BOOKMARK || - old_position < 0 || - old_position >= caja_bookmark_list_length (sidebar->bookmarks)) - { + if (type != PLACES_BOOKMARK || old_position < 0) + return; + + list_length = caja_bookmark_list_length (sidebar->bookmarks); + if (((guint) old_position) >= list_length) return; - } caja_bookmark_list_move_item (sidebar->bookmarks, old_position, new_position); |