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~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b263ccbdfe176bac63e53bb9a3f0d7f245d74aac;p=thirdparty%2Flibarchive.git Fix build failure on FreeBSD/powerpc64. --- diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index bd4bd1abb..911d168da 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003-2011 Tim Kientzle - * Copyright (c) 2011 Michihiro NAKAJIMA + * Copyright (c) 2011-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2333,7 +2333,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 */ @@ -2357,11 +2357,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, @@ -2381,13 +2381,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--; } }