From 7a1c2807393bdb29f4e0eac45ae20288e4c297f0 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Sun, 2 Aug 2009 21:39:30 -0400 Subject: [PATCH] Fix minor build problem on systems with 16-bit uid_t and gid_t, such as Windows. SVN-Revision: 1322 --- libarchive/archive_write_set_format_pax.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c index dfe8ca1ad..c0073c5ce 100644 --- a/libarchive/archive_write_set_format_pax.c +++ b/libarchive/archive_write_set_format_pax.c @@ -625,7 +625,7 @@ archive_write_pax_header(struct archive_write *a, } /* If numeric GID is too large, add 'gid' to pax extended attrs. */ - if (archive_entry_gid(entry_main) >= (1 << 18)) { + if ((unsigned int)archive_entry_gid(entry_main) >= (1 << 18)) { add_pax_attr_int(&(pax->pax_header), "gid", archive_entry_gid(entry_main)); need_extension = 1; @@ -650,7 +650,7 @@ archive_write_pax_header(struct archive_write *a, } /* If numeric UID is too large, add 'uid' to pax extended attrs. */ - if (archive_entry_uid(entry_main) >= (1 << 18)) { + if ((unsigned int)archive_entry_uid(entry_main) >= (1 << 18)) { add_pax_attr_int(&(pax->pax_header), "uid", archive_entry_uid(entry_main)); need_extension = 1; @@ -897,11 +897,11 @@ archive_write_pax_header(struct archive_write *a, archive_strlen(&(pax->pax_header))); /* Copy uid/gid (but clip to ustar limits). */ uid = archive_entry_uid(entry_main); - if ((long long)uid >= 1 << 18) + if ((unsigned int)uid >= 1 << 18) uid = (uid_t)(1 << 18) - 1; archive_entry_set_uid(pax_attr_entry, uid); gid = archive_entry_gid(entry_main); - if ((long long)gid >= 1 << 18) + if ((unsigned int)gid >= 1 << 18) gid = (gid_t)(1 << 18) - 1; archive_entry_set_gid(pax_attr_entry, gid); /* Copy mode over (but not setuid/setgid bits) */ -- 2.47.3