From 18f30e7886bb98f692c28dd4b6727358ed1202a1 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sat, 11 Nov 2006 14:12:39 +0200 Subject: [PATCH] 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. --- src/protocol/http/http.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index 58b9e100..00c7bfbe 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -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);