From: Michihiro NAKAJIMA Date: Sat, 11 Feb 2012 14:42:13 +0000 (+0900) Subject: Fix build failure on FreeBSD/powerpc64. X-Git-Tag: v3.0.4~2^2~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4702e9bda3bfd40fe337f465b270750b73e1e9a1;p=thirdparty%2Flibarchive.git Fix build failure on FreeBSD/powerpc64. --- diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index ed3b965d3..89f043a2a 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -2242,7 +2242,7 @@ best_effort_strncat_in_locale(struct archive_string *as, const void *_p, { size_t remaining; char *outp; - const char *inp; + const uint8_t *inp; size_t avail; int return_value = 0; /* success */ @@ -2266,11 +2266,11 @@ best_effort_strncat_in_locale(struct archive_string *as, const void *_p, return (-1); remaining = length; - inp = (const char *)_p; + inp = (const uint8_t *)_p; outp = as->s + as->length; avail = as->buffer_length - as->length -1; while (*inp && remaining > 0) { - if (*inp < 0 && (sc->flag & SCONV_TO_UTF8)) { + if (*inp > 127 && (sc->flag & SCONV_TO_UTF8)) { if (avail < UTF8_R_CHAR_SIZE) { as->length = outp - as->s; if (NULL == archive_string_ensure(as, @@ -2290,13 +2290,13 @@ best_effort_strncat_in_locale(struct archive_string *as, const void *_p, inp++; remaining--; return_value = -1; - } else if (*inp < 0) { + } else if (*inp > 127) { *outp++ = '?'; inp++; remaining--; return_value = -1; } else { - *outp++ = *inp++; + *outp++ = (char)*inp++; remaining--; } }