1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-24 00:56:14 +00:00

decompress_data: Always initialize to_read, avoiding a GCC warning.

"'to_read' may be used uninitialized in this function" was a false warning
but removing it will make important warnings easier to see.
This commit is contained in:
Kalle Olavi Niemitalo 2006-11-11 14:12:39 +02:00 committed by Kalle Olavi Niemitalo
parent 810a1fc591
commit 18f30e7886

View File

@ -990,13 +990,14 @@ decompress_data(struct connection *conn, unsigned char *data, int len,
}
do {
int to_read;
/* The initial value is used only when state == NORMAL.
* Unconditional initialization avoids a GCC warning. */
int to_read = PIPE_BUF / 2;
if (state == NORMAL) {
/* ... we aren't finishing yet. */
int written;
to_read = PIPE_BUF / 2;
written = safe_write(conn->stream_pipes[1], data,
len > to_read ? to_read : len);