summaryrefslogtreecommitdiff
path: root/libarchive/archive_string.c
diff options
context:
space:
mode:
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-02-11 23:42:13 +0900
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>2012-02-15 01:17:36 +0900
commit4702e9bda3bfd40fe337f465b270750b73e1e9a1 (patch)
treed27d41be2753e7f78822e98c3d3c4768fe3c9200 /libarchive/archive_string.c
parentf30dc311bafff055bbcfcb272834566e15fce4dd (diff)
downloadlibarchive-4702e9bda3bfd40fe337f465b270750b73e1e9a1.tar.gz
Fix build failure on FreeBSD/powerpc64.
Diffstat (limited to 'libarchive/archive_string.c')
-rw-r--r--libarchive/archive_string.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c
index ed3b965d..89f043a2 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--;
}
}