diff options
Diffstat (limited to 'libshouldbeinlibc/idvec-rep.c')
-rw-r--r-- | libshouldbeinlibc/idvec-rep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libshouldbeinlibc/idvec-rep.c b/libshouldbeinlibc/idvec-rep.c index 16408a4d..4fc7712d 100644 --- a/libshouldbeinlibc/idvec-rep.c +++ b/libshouldbeinlibc/idvec-rep.c @@ -129,7 +129,7 @@ lookup_uid (uid_t uid) { char buf[1024]; struct passwd _pw, *pw; - if (getpwuid_r (uid, &_pw, buf, sizeof buf, &pw) == 0) + if (getpwuid_r (uid, &_pw, buf, sizeof buf, &pw) == 0 && pw) return strdup (pw->pw_name); else return 0; @@ -141,7 +141,7 @@ lookup_gid (gid_t gid) { char buf[1024]; struct group _gr, *gr; - if (getgrgid_r (gid, &_gr, buf, sizeof buf, &gr) == 0) + if (getgrgid_r (gid, &_gr, buf, sizeof buf, &gr) == 0 && gr) return strdup (gr->gr_name); else return 0; |