Skip to contentSkip to conversation

remote-curl.c: Fix a gcc warning

PATCH New Ramsay Jones 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remote-curl.c: Fix a gcc warning

In particular, gcc complains as follows:

CC remote-curl.o
remote-curl.c: In function `rpc_service':
remote-curl.c:403: warning: 'gzip_size' might be used uninitialized \
in this function

The 'gzip_size' variable would not, in fact, be used uninitialized. However, in order to suppress the warning, we simply initialize the variable to zero in it's declaration.

---

Hi Jeff,

Could you please squash this into commit df126e108 ("remote-curl: hoist gzip buffer size to top of post_rpc", 31-10-2012), which is part of your 'jk/maint-http-half-auth-fetch' branch.

Thanks!

ATB,
Ramsay Jones

 remote-curl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
remote-curl.c +1 -1
index d8b3600..9a8b123 100644
@@ -400,7 +400,7 @@ static int post_rpc(struct rpc_state *rpc)
 	struct curl_slist *headers = NULL;
 	int use_gzip = rpc->gzip_request;
 	char *gzip_body = NULL;
-	size_t gzip_size;
+	size_t gzip_size = 0;
 	int err, large_request = 0;
 
 	/* Try to load the entire request, if we can fit it into the
Signature · 1 line
1.8.0