changeset 30326:9de3c5453668

Correct use of uninitialized variable on AIX.
author Bruno Haible <bruno@clisp.org>
date Mon, 13 Oct 2008 04:27:50 +0200
parents 4ce2ac70f815
children 8e01381440ee
files ChangeLog tests/test-sameacls.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 13 02:35:20 2008 +0200
+++ b/ChangeLog	Mon Oct 13 04:27:50 2008 +0200
@@ -1,3 +1,8 @@
+2008-10-12  Bruno Haible  <bruno@clisp.org>
+
+	* tests/test-sameacls.c (main) [AIX]: Clear type argument before
+	calling aclx_get.
+
 2008-10-12  Bruno Haible  <bruno@clisp.org>
 
 	Use msvcrt aware primitives for creation/termination of Win32 threads.
--- a/tests/test-sameacls.c	Mon Oct 13 02:35:20 2008 +0200
+++ b/tests/test-sameacls.c	Mon Oct 13 04:27:50 2008 +0200
@@ -447,6 +447,7 @@
   mode_t mode2;
   char text2[1000];
 
+  memset (&type1, 0, sizeof (type1)); /* type1 = ACL_ANY */
   if (aclx_get (file1, 0, &type1, acl1, &aclsize1, &mode1) < 0)
     {
       fprintf (stderr, "error accessing the ACLs of file %s\n", file1);
@@ -460,6 +461,7 @@
       abort ();
     }
 
+  memset (&type2, 0, sizeof (type2)); /* type2 = ACL_ANY */
   if (aclx_get (file2, 0, &type2, acl2, &aclsize2, &mode2) < 0)
     {
       fprintf (stderr, "error accessing the ACLs of file %s\n", file2);