From b16468499e57e1b8768ec0f23f54f65d998bfb9c Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Nov 2009 11:28:59 -0500 Subject: [PATCH] Extract ACL octal digit using mask of type 'int' In archive_read_support_format_tar.c we mask a mode with ~0777777 to erase the non-ACL octal digits. The mode is represented by int64_t so the compiler sign-extends the our literal mask from type int to int64_t for application of the & operator. Unfortunately the resulting int64_t type is not allowed in switch() on some old compilers (like HP). Since we are looking only for values that fit in an int after the mask anyway, we might as well cast to int for the entire mask operation. This also avoids depending on the compiler to preserve the intention of the mask with sign-extension, making the code easier to understand anyway. SVN-Revision: 1656 --- libarchive/archive_read_support_format_tar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c index 716ecd79e..79ab246c8 100644 --- a/libarchive/archive_read_support_format_tar.c +++ b/libarchive/archive_read_support_format_tar.c @@ -773,7 +773,7 @@ header_Solaris_ACL(struct archive_read *a, struct tar *tar, } p++; } - switch (type & ~0777777) { + switch ((int)type & ~0777777) { case 01000000: /* POSIX.1e ACL */ break; -- 2.47.3