Skip to content

Commit

Permalink
fixed a 64bit big endian issue
Browse files Browse the repository at this point in the history
For https://bugzilla.gnome.org/show_bug.cgi?id=671176
patch fixes a 64bit endian issue, making libxml2 work (again) on ppc64
unsigned int and size_t are differently sized on 64bit.
  • Loading branch information
msmeissn authored and veillard committed May 7, 2012
1 parent 40db1ee commit 9964492
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xzlib.c
Expand Up @@ -229,9 +229,14 @@ xz_avail(xz_statep state)
if (state->err != LZMA_OK)
return -1;
if (state->eof == 0) {
if (xz_load(state, state->in, state->size,
(unsigned int *) &(strm->avail_in)) == -1)
/* avail_in is size_t, which is not necessary sizeof(unsigned) */
unsigned tmp = strm->avail_in;

if (xz_load(state, state->in, state->size, &tmp) == -1) {
strm->avail_in = tmp;
return -1;
}
strm->avail_in = tmp;
strm->next_in = state->in;
}
return 0;
Expand Down

0 comments on commit 9964492

Please sign in to comment.