Compile fixes. Fixes warnings.
This commit is contained in:
parent
27153ae92b
commit
1dc04372df
@ -546,7 +546,7 @@ static void check_grp_file (int *errors, bool *changed)
|
||||
* Check for invalid user ID.
|
||||
*/
|
||||
if (grp->gr_gid == (gid_t)-1) {
|
||||
printf (_("invalid user ID '%lu'\n"), grp->gr_gid);
|
||||
printf (_("invalid user ID '%lu'\n"), (long unsigned int)grp->gr_gid);
|
||||
*errors += 1;
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,7 @@ static void check_pw_file (int *errors, bool *changed)
|
||||
* Check for invalid user ID.
|
||||
*/
|
||||
if (pwd->pw_uid == (uid_t)-1) {
|
||||
printf (_("invalid user ID '%lu'\n"), pwd->pw_uid);
|
||||
printf (_("invalid user ID '%lu'\n"), (long unsigned int)pwd->pw_uid);
|
||||
*errors += 1;
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ static struct group *getgr_nam_gid (const char *grname)
|
||||
char *endptr;
|
||||
|
||||
errno = 0;
|
||||
gid = strtoll (grname, &errptr, 10);
|
||||
gid = strtoll (grname, &endptr, 10);
|
||||
if ( ('\0' != *grname)
|
||||
&& ('\0' == *endptr)
|
||||
&& (ERANGE != errno)
|
||||
@ -284,10 +284,10 @@ static struct group *getgr_nam_gid (const char *grname)
|
||||
static long get_number (const char *numstr)
|
||||
{
|
||||
long val;
|
||||
char *errptr;
|
||||
char *endptr;
|
||||
|
||||
val = strtol (numstr, &errptr, 10);
|
||||
if (('\0' == *numstr) || ('\0' != *errptr) || (ERANGE == errno)) {
|
||||
val = strtol (numstr, &endptr, 10);
|
||||
if (('\0' == *numstr) || ('\0' != *endptr) || (ERANGE == errno)) {
|
||||
fprintf (stderr,
|
||||
_("%s: invalid numeric argument '%s'\n"),
|
||||
Prog, numstr);
|
||||
|
@ -196,7 +196,7 @@ static struct group *getgr_nam_gid (const char *grname)
|
||||
char *endptr;
|
||||
|
||||
errno = 0;
|
||||
val = strtoll (grname, &errptr, 10);
|
||||
val = strtoll (grname, &endptr, 10);
|
||||
if ( ('\0' != *grname)
|
||||
&& ('\0' == *endptr)
|
||||
&& (ERANGE != errno)
|
||||
@ -787,10 +787,10 @@ static void grp_update (void)
|
||||
static long get_number (const char *numstr)
|
||||
{
|
||||
long val;
|
||||
char *errptr;
|
||||
char *endptr;
|
||||
|
||||
val = strtol (numstr, &errptr, 10);
|
||||
if (('\0' != *errptr) || (ERANGE == errno)) {
|
||||
val = strtol (numstr, &endptr, 10);
|
||||
if (('\0' != *endptr) || (ERANGE == errno)) {
|
||||
fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog,
|
||||
numstr);
|
||||
exit (E_BAD_ARG);
|
||||
|
Loading…
Reference in New Issue
Block a user