diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-03-16 02:01:20 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-03-16 02:01:20 +0100 |
commit | a143ba7e7179b9f7654ae125aa9b273a66d35ba5 (patch) | |
tree | 824a4d2ebba4065897a5d772748b9b0dd1c62471 | |
parent | 4fe1c74b42f99b3682114e1dab1200f6ced6881f (diff) |
getgrouplist.3: Use same type in both sides of comparison
This removes a warning.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | man3/getgrouplist.3 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/man3/getgrouplist.3 b/man3/getgrouplist.3 index 41389b6c3..5e11b426b 100644 --- a/man3/getgrouplist.3 +++ b/man3/getgrouplist.3 @@ -142,10 +142,10 @@ ngroups = 3 int main(int argc, char *argv[]) { - int ngroups; - struct passwd *pw; - struct group *gr; - gid_t *groups; + int ngroups; + gid_t *groups; + struct group *gr; + struct passwd *pw; \& if (argc != 3) { fprintf(stderr, "Usage: %s <user> <ngroups>\en", argv[0]); @@ -179,7 +179,7 @@ main(int argc, char *argv[]) /* Display list of retrieved groups, along with group names. */ \& fprintf(stderr, "ngroups = %d\en", ngroups); - for (size_t j = 0; j < ngroups; j++) { + for (int j = 0; j < ngroups; j++) { printf("%d", groups[j]); gr = getgrgid(groups[j]); if (gr != NULL) |