lib/, src/: Rename some local variables
'endptr' is appropriate internally in strtol(3) because it's a pointer to 'end', and 'end' itself is a pointer to one-after-the-last character of the numeric string. In other words, endptr == &end However, naming the pointer whose address we pass to strtol(3)'s 'endptr' feels wrong, and causes me trouble while parsing the code; I need to double check the number of dereferences, because something feels wrong in my head. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
f40bd94856
commit
98aefe8772
+3
-3
@@ -857,14 +857,14 @@ static int get_groups (char *list)
|
||||
*/
|
||||
static struct group * get_local_group(char * grp_name)
|
||||
{
|
||||
char *end;
|
||||
const struct group *grp;
|
||||
struct group *result_grp = NULL;
|
||||
long long gid;
|
||||
char *endptr;
|
||||
|
||||
gid = strtoll (grp_name, &endptr, 10);
|
||||
gid = strtoll(grp_name, &end, 10);
|
||||
if ( ('\0' != *grp_name)
|
||||
&& ('\0' == *endptr)
|
||||
&& ('\0' == *end)
|
||||
&& (ERANGE != errno)
|
||||
&& (gid == (gid_t)gid)) {
|
||||
grp = gr_locate_gid (gid);
|
||||
|
||||
Reference in New Issue
Block a user