From 0b6e4a388c25fbc35b0eaf801e8a75712355eb9b Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 7 Aug 2022 12:23:50 +0200 Subject: Fix -Wsign-conversion warning --- src/polkitmateauthenticationdialog.c | 4 ++-- src/polkitmateauthenticator.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/polkitmateauthenticationdialog.c b/src/polkitmateauthenticationdialog.c index 13123f2..14edc0e 100644 --- a/src/polkitmateauthenticationdialog.c +++ b/src/polkitmateauthenticationdialog.c @@ -650,7 +650,7 @@ polkit_mate_authentication_dialog_constructed (GObject *object) GtkWidget *content_area; gboolean have_user_combobox; gchar *s; - guint rows; + gint rows; dialog = POLKIT_MATE_AUTHENTICATION_DIALOG (object); @@ -791,7 +791,7 @@ polkit_mate_authentication_dialog_constructed (GObject *object) rows = 0; if (dialog->priv->details != NULL) { - guint n; + gint n; gchar **keys; keys = polkit_details_get_keys (dialog->priv->details); diff --git a/src/polkitmateauthenticator.c b/src/polkitmateauthenticator.c index 1ce8cc6..94f78c1 100644 --- a/src/polkitmateauthenticator.c +++ b/src/polkitmateauthenticator.c @@ -243,11 +243,14 @@ polkit_mate_authenticator_new (const gchar *action_id, for (l = authenticator->identities, n = 0; l != NULL; l = l->next, n++) { PolkitUnixUser *user = POLKIT_UNIX_USER (l->data); - uid_t uid; + gint uid; struct passwd *passwd; uid = polkit_unix_user_get_uid (user); - passwd = getpwuid (uid); + if (uid == -1) + continue; + + passwd = getpwuid ((uid_t) uid); authenticator->users[n] = g_strdup (passwd->pw_name); } -- cgit v1.2.1