From c833a6241893c7e566a5eed762661942e4cd90d3 Mon Sep 17 00:00:00 2001 From: Todd Lewis Date: Mon, 29 Oct 2018 18:33:48 +0000 Subject: [PATCH] Fix user and group name to number conversion for uid/gid above 2^31. --- pgrep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgrep.c b/pgrep.c index bde74487..8b82a542 100644 --- a/pgrep.c +++ b/pgrep.c @@ -280,7 +280,7 @@ static int conv_uid (const char *restrict name, struct el *restrict e) xwarnx(_("invalid user name: %s"), name); return 0; } - e->num = pwd->pw_uid; + e->num = (int) pwd->pw_uid; return 1; } @@ -297,7 +297,7 @@ static int conv_gid (const char *restrict name, struct el *restrict e) xwarnx(_("invalid group name: %s"), name); return 0; } - e->num = grp->gr_gid; + e->num = (int) grp->gr_gid; return 1; }