summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-05-31 21:44:09 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-05-31 21:44:09 +0000
commit52819077bb4348529466a387988b6785585c3829 (patch)
tree4293b16a347aa51d971fa48a10e33b3c86b6dc12 /pw/pw_user.c
parent861c9030d5b3c835e61181480716d6af26d463e4 (diff)
downloadpw-darwin-52819077bb4348529466a387988b6785585c3829.tar.gz
pw-darwin-52819077bb4348529466a387988b6785585c3829.zip
Cast -1 to uid_t and bump WARNING level to 3
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index 95a4519..112d018 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -335,7 +335,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
if (pwd == NULL) {
if (mode == M_PRINT && getarg(args, 'F')) {
fakeuser.pw_name = a_name ? a_name->val : "nouser";
- fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : -1;
+ fakeuser.pw_uid = a_uid ? (uid_t) atol(a_uid->val) : (uid_t) -1;
return print_user(&fakeuser,
getarg(args, 'P') != NULL,
getarg(args, '7') != NULL);
@@ -791,7 +791,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args)
grp = GETGRGID(pwd->pw_gid);
pw_log(cnf, mode, W_USER, "%s(%ld):%s(%ld):%s:%s:%s",
pwd->pw_name, (long) pwd->pw_uid,
- grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : -1),
+ grp ? grp->gr_name : "unknown", (long) (grp ? grp->gr_gid : (uid_t)-1),
pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell);
/*