Avoid compiler warnings with some versions of GCC.
git-svn-id: https://shellinabox.googlecode.com/svn/trunk@201 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
parent
ef5177349e
commit
5a75b2f091
1 changed files with 6 additions and 6 deletions
|
@ -736,11 +736,11 @@ static const struct passwd *getPWEnt(uid_t uid) {
|
||||||
#endif
|
#endif
|
||||||
check(buf = malloc(len));
|
check(buf = malloc(len));
|
||||||
check(!getpwuid_r(uid, &pwbuf, buf, len, &pw) && pw);
|
check(!getpwuid_r(uid, &pwbuf, buf, len, &pw) && pw);
|
||||||
if (!pw->pw_name ) pw->pw_name = "";
|
if (!pw->pw_name ) pw->pw_name = (char *)"";
|
||||||
if (!pw->pw_passwd) pw->pw_passwd = "";
|
if (!pw->pw_passwd) pw->pw_passwd = (char *)"";
|
||||||
if (!pw->pw_gecos ) pw->pw_gecos = "";
|
if (!pw->pw_gecos ) pw->pw_gecos = (char *)"";
|
||||||
if (!pw->pw_dir ) pw->pw_dir = "";
|
if (!pw->pw_dir ) pw->pw_dir = (char *)"";
|
||||||
if (!pw->pw_shell ) pw->pw_shell = "";
|
if (!pw->pw_shell ) pw->pw_shell = (char *)"";
|
||||||
struct passwd *passwd;
|
struct passwd *passwd;
|
||||||
check(passwd = calloc(sizeof(struct passwd) +
|
check(passwd = calloc(sizeof(struct passwd) +
|
||||||
strlen(pw->pw_name) +
|
strlen(pw->pw_name) +
|
||||||
|
|
Loading…
Reference in a new issue