From 949bab33700e0c26aefe97b1f0c93fca4af677bd Mon Sep 17 00:00:00 2001 From: Ulrich Ölmann Date: Sun, 3 Feb 2019 22:48:04 +0100 Subject: base64: remove unused variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable seems to be a leftover from importing the function from busybox-1.23.2 and by cleaning up the code the compiler does not emit the following warning anymore: src/base64.c:34:14: warning: variable ‘src_tail’ set but not used [-Wunused-but-set-variable] const char *src_tail; ^~~~~~~~ Signed-off-by: Ulrich Ölmann Signed-off-by: Roland Hieber --- src/base64.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/base64.c b/src/base64.c index 02cac16..270c64a 100644 --- a/src/base64.c +++ b/src/base64.c @@ -31,7 +31,6 @@ static const char const uuenc_tbl_base64[65 + 1] = { */ int decode_base64(char *p_dst, int dst_len, const char *src) { - const char *src_tail; char *dst = p_dst; int length = 0; @@ -40,7 +39,6 @@ int decode_base64(char *p_dst, int dst_len, const char *src) int count = 0; /* Fetch up to four 6-bit values */ - src_tail = src; while (count < 4) { const char *table_ptr; int ch; @@ -54,18 +52,9 @@ int decode_base64(char *p_dst, int dst_len, const char *src) */ do { ch = *src; - if (ch == '\0') { - /* - * Example: - * If we decode "QUJD ", we want - * to return ptr to NUL, not to ' ', - * because we did fully decode - * the string (to "ABC"). - */ - if (count == 0) - src_tail = src; + if (ch == '\0') goto ret; - } + src++; table_ptr = strchr(uuenc_tbl_base64, ch); } while (!table_ptr); -- cgit v1.2.3