From 79f7428bf8561f13b8cac37b0b9c455861f82f6b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 13 Nov 2023 23:56:42 +0100 Subject: bindfs.c|usermap.c: Address warning -Wsign-compare MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For example: > src/bindfs.c: In function ‘getattr_common’: > src/bindfs.c:449:26: error: comparison of integer expressions of different signedness: ‘uid_t’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare] > 449 | if (settings.new_uid != -1) > | ^~ > --- src/usermap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/usermap.c') diff --git a/src/usermap.c b/src/usermap.c index f745e74..eb7b61c 100644 --- a/src/usermap.c +++ b/src/usermap.c @@ -52,7 +52,7 @@ UsermapStatus usermap_add_uid(UserMap *map, uid_t from, uid_t to) map->user_from = (uid_t*)realloc(map->user_from, map->user_capacity * sizeof(uid_t)); map->user_to = (uid_t*)realloc(map->user_to, map->user_capacity * sizeof(uid_t)); } - if (usermap_get_uid_or_default(map, from, -1) != -1) { + if (usermap_get_uid_or_default(map, from, -1) != (uid_t)-1) { return usermap_status_duplicate_key; } i = map->user_size; @@ -77,7 +77,7 @@ UsermapStatus usermap_add_gid(UserMap *map, gid_t from, gid_t to) map->group_from = (gid_t*)realloc(map->group_from, map->group_capacity * sizeof(gid_t)); map->group_to = (gid_t*)realloc(map->group_to, map->group_capacity * sizeof(gid_t)); } - if (usermap_get_gid_or_default(map, from, -1) != -1) { + if (usermap_get_gid_or_default(map, from, -1) != (gid_t)-1) { return usermap_status_duplicate_key; } i = map->group_size; -- cgit v1.2.3