summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-01-14 19:17:39 +0000
committerPádraig Brady <P@draigBrady.com>2009-01-16 11:06:09 +0000
commit46d6df933ec6171fcfa0220dfb8f18f68293797b (patch)
tree77388a86324cecd5f76700dbec57803a7bffa847 /src
parent7b1967351c80c56abc5b8c6c4a66ffba80050c5c (diff)
downloadcoreutils-46d6df933ec6171fcfa0220dfb8f18f68293797b.tar.xz
simplify mgetgroups() and avoid -Wsign-compare warnings
* gl/lib/mgetgroups.c: Avoid -Wsign-compare warning by using unsigned types for the parameters of the new function realloc_groupbuf(). mgetgroups() was refactored to use this function rather than explicitly allocating and copying from automatic storage itself. * src/group-list.c: Use int rather than size_t as variable is used in signed comparisons. * src/id.c: ditto.
Diffstat (limited to 'src')
-rw-r--r--src/group-list.c4
-rw-r--r--src/id.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/group-list.c b/src/group-list.c
index 3547ed669..46895b474 100644
--- a/src/group-list.c
+++ b/src/group-list.c
@@ -1,5 +1,5 @@
/* group-list.c --Print a list of group IDs or names.
- Copyright (C) 1989-2008 Free Software Foundation, Inc.
+ Copyright (C) 1989-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ print_group_list (const char *username,
#if HAVE_GETGROUPS
{
GETGROUPS_T *groups;
- size_t i;
+ int i;
int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1),
&groups);
diff --git a/src/id.c b/src/id.c
index 156b066dd..05ad2d86b 100644
--- a/src/id.c
+++ b/src/id.c
@@ -1,5 +1,5 @@
/* id -- print real and effective UIDs and GIDs
- Copyright (C) 1989-2008 Free Software Foundation, Inc.
+ Copyright (C) 1989-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -294,7 +294,7 @@ print_full_info (const char *username)
#if HAVE_GETGROUPS
{
GETGROUPS_T *groups;
- size_t i;
+ int i;
int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1),
&groups);