Fix a strict aliasing warning from GCC 4.1.

Thanks to: Joerg Sonnenberger
Approved by: re (hrs)
MFC after: 3 days
This commit is contained in:
Tim Kientzle 2007-07-20 01:28:50 +00:00
parent 660665be6b
commit 8ea9716c0c

View file

@ -113,6 +113,7 @@ child_read(struct archive_read *a, char *buf, size_t buf_len)
{
struct archive_decompress_program *state = a->decompressor->data;
ssize_t ret, requested;
const void *child_buf;
if (state->child_stdout == -1)
return (-1);
@ -138,8 +139,10 @@ restart_read:
return (-1);
if (state->child_in_buf_avail == 0) {
child_buf = state->child_in_buf;
ret = (a->client_reader)(&a->archive,
a->client_data, (const void **)&state->child_in_buf);
a->client_data,&child_buf);
state->child_in_buf = (const char *)child_buf;
if (ret < 0) {
close(state->child_stdin);