This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
gid_t signedness.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 25 Jun 2015 01:23:06 +0000 (21:23 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 27 Jun 2015 03:09:47 +0000 (23:09 -0400)
Coverity CID 104786.

pp_sys.c

index 6435781..4f337f0 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -5506,7 +5506,13 @@ PP(pp_ggrent)
        grent = (const struct group *)getgrnam(name);
     }
     else if (which == OP_GGRGID) {
+#if Gid_t_sign == 1
+       const Gid_t gid = POPu;
+#elif Gid_t_sign == -1
        const Gid_t gid = POPi;
+#else
+#  error "Unexpected Gid_t_sign"
+#endif
        grent = (const struct group *)getgrgid(gid);
     }
     else