library: tweak that change to 'supgrps_from_supgids()'

It's good that those Qualys folks were looking over my
shoulder. They suggested a change to that commit shown
below. This improvement was obviously a better choice.

Reference(s):
. original change
commit f9a8009e27

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2018-06-01 00:00:00 -05:00 committed by Craig Small
parent f9a8009e27
commit 3352bddba5

View File

@ -475,11 +475,7 @@ static void supgrps_from_supgids (proc_t *p) {
while (',' == *s) ++s;
gid = strtol(s, &end, 10);
if (end <= s) {
if (!p->supgrp)
p->supgrp = xstrdup("-");
break;
}
if (end <= s) break;
s = end;
g = pwcache_get_group(gid);
@ -491,6 +487,9 @@ static void supgrps_from_supgids (proc_t *p) {
else if (len >= max) len = max-1;
t += len;
} while (*s);
if (!p->supgrp)
p->supgrp = xstrdup("-");
}
///////////////////////////////////////////////////////////////////////