From 6e28563d0023ce0261e2756e5eb120790c5fe6e9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 15 Mar 2017 00:47:23 +0100 Subject: [PATCH] libbb: fix gzip_thread() warnings - mark function static - add missing return statement - avoid uninitialized use of "len" Signed-off-by: Jo-Philipp Wich --- libbb/gzip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libbb/gzip.c b/libbb/gzip.c index db22523..dc3b283 100644 --- a/libbb/gzip.c +++ b/libbb/gzip.c @@ -41,11 +41,11 @@ static void to_devnull(int fd) close(devnull); } -void *gzip_thread(void *ptr) +static void *gzip_thread(void *ptr) { struct gzip_handle *zh = ptr; char buf[4096]; - int len, ret; + int len = 0, ret; while (1) { if (zh->file) @@ -63,6 +63,8 @@ void *gzip_thread(void *ptr) close(zh->wfd); zh->wfd = -1; + + return NULL; } int gzip_exec(struct gzip_handle *zh, const char *filename) -- 2.30.2