Fix a segfault when looking up a non-existent group.

This commit is contained in:
kientzle 2004-05-18 23:40:25 +00:00
parent 18fd75c1c3
commit 2ccbdbb7fe

View File

@ -1225,7 +1225,7 @@ lookup_gname_helper(struct bsdtar *bsdtar, const char **name, id_t id)
errno = 0;
grent = getgrgid((gid_t)id);
if (grent == NULL && errno != 0) {
if (grent == NULL) {
*name = NULL;
if (errno != 0)
bsdtar_warnc(bsdtar, errno, "getgrgid(%d) failed", id);