mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05: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:
parent
810a1fc591
commit
18f30e7886
@ -990,13 +990,14 @@ decompress_data(struct connection *conn, unsigned char *data, int len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
do {
|
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) {
|
if (state == NORMAL) {
|
||||||
/* ... we aren't finishing yet. */
|
/* ... we aren't finishing yet. */
|
||||||
int written;
|
int written;
|
||||||
|
|
||||||
to_read = PIPE_BUF / 2;
|
|
||||||
written = safe_write(conn->stream_pipes[1], data,
|
written = safe_write(conn->stream_pipes[1], data,
|
||||||
len > to_read ? to_read : len);
|
len > to_read ? to_read : len);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user