summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-08-08 01:21:10 +0000
committerkientzle <kientzle@FreeBSD.org>2004-08-08 01:21:10 +0000
commit0433526613ea28c6e706eb5c901d2ee4f4360543 (patch)
treec147f1939654705d357a568c9d0cdcc08075e09f /lib/libarchive
parent5c7a45a41f9268c9e1c0aafefdabbc8f4b48d047 (diff)
downloadFreeBSD-src-0433526613ea28c6e706eb5c901d2ee4f4360543.zip
FreeBSD-src-0433526613ea28c6e706eb5c901d2ee4f4360543.tar.gz
Use 'int' for certain wide-character conversions instead of wchar_t.
That quiets some compiler warnings on platforms with 16-bit wchar_t. With this change, libarchive now compiles cleanly on Win32/cygwin.
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_read_support_format_tar.c10
-rw-r--r--lib/libarchive/archive_write_set_format_pax.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/libarchive/archive_read_support_format_tar.c b/lib/libarchive/archive_read_support_format_tar.c
index 6628026..76a228e 100644
--- a/lib/libarchive/archive_read_support_format_tar.c
+++ b/lib/libarchive/archive_read_support_format_tar.c
@@ -1519,7 +1519,7 @@ static size_t
UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n)
{
int ch, i, len, mask;
- wchar_t lbound, wch;
+ int lbound, wch;
if (s == NULL)
/* Reset to initial shift state (no-op) */
@@ -1601,7 +1601,11 @@ UTF8_mbrtowc(wchar_t *pwc, const char *s, size_t n)
errno = EILSEQ;
return ((size_t)-1);
}
- if (pwc != NULL)
- *pwc = wch;
+ if (pwc != NULL) {
+ if (wch < WCHAR_MAX)
+ *pwc = (wchar_t)wch;
+ else
+ *pwc = '?';
+ }
return (wch == L'\0' ? 0 : len);
}
diff --git a/lib/libarchive/archive_write_set_format_pax.c b/lib/libarchive/archive_write_set_format_pax.c
index 70d32ba..307ee1d 100644
--- a/lib/libarchive/archive_write_set_format_pax.c
+++ b/lib/libarchive/archive_write_set_format_pax.c
@@ -188,7 +188,7 @@ add_pax_attr_w(struct archive_string *as, const char *key, const wchar_t *wval)
{
int utf8len;
const wchar_t *wp;
- wchar_t wc;
+ int wc;
char *utf8_value, *p;
utf8len = 0;
OpenPOWER on IntegriCloud