X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-getgroups.c;h=aed80f181353a2faa4bf0037a4755006ae2372b3;hb=63983c0aac914c1a585cb6a7d0b16dc170b6ee3e;hp=ffa873f2e262f3d4522b2a40470071980ca75365;hpb=6e4b15b5ee28b52b4a03c74fe8a9ac9bc8a976ea;p=gnulib.git diff --git a/tests/test-getgroups.c b/tests/test-getgroups.c index ffa873f2e..aed80f181 100644 --- a/tests/test-getgroups.c +++ b/tests/test-getgroups.c @@ -23,6 +23,7 @@ #include #include #include +#include #define ASSERT(expr) \ do \ @@ -51,7 +52,7 @@ main (int argc, char **argv _UNUSED_PARAMETER_) } ASSERT (0 <= result); ASSERT (result + 1 < SIZE_MAX / sizeof *groups); - groups = malloc (result + 1 * sizeof *groups); + groups = malloc ((result + 1) * sizeof *groups); ASSERT (groups); groups[result] = -1; /* Check for EINVAL handling. Not all processes have supplemental