From 52c5891fa3a15c079002574edc747bbf0ea3178b Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Mon, 1 Oct 2007 21:25:08 +0000 Subject: [PATCH] Code around a bug in getgrgid_r which I've just noticed exists in some versions of glibc but not others. It fails to return a value through its last parameter. getpwuid_r doesn't seem to have the same bug, but avoid its last parameter too as a bit of defensive programming. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/tarstrm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/tarstrm.cpp b/src/common/tarstrm.cpp index 3847943a38..ae2dbf159b 100644 --- a/src/common/tarstrm.cpp +++ b/src/common/tarstrm.cpp @@ -360,7 +360,7 @@ static wxString wxTarUserName(int uid) struct passwd pw; if (getpwuid_r(uid, &pw, buf.data(), bufsize, &ppw) == 0) - return wxString(ppw->pw_name, wxConvLibc); + return wxString(pw.pw_name, wxConvLibc); #else if ((ppw = getpwuid(uid)) != NULL) return wxString(ppw->pw_name, wxConvLibc); @@ -382,7 +382,7 @@ static wxString wxTarGroupName(int gid) struct group gr; if (getgrgid_r(gid, &gr, buf.data(), bufsize, &pgr) == 0) - return wxString(pgr->gr_name, wxConvLibc); + return wxString(gr.gr_name, wxConvLibc); #else if ((pgr = getgrgid(gid)) != NULL) return wxString(pgr->gr_name, wxConvLibc);