summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2019-02-03 22:48:04 +0100
committerRoland Hieber <rhi@pengutronix.de>2019-02-07 12:34:16 +0100
commit949bab33700e0c26aefe97b1f0c93fca4af677bd (patch)
treeb0425ebfc5a6a3cb0b6d6ce3e3d0c93c2e56f79f
parent338b9962e28a41bc31815f8fcc7bfc23ae94ecd4 (diff)
downloaddt-utils-949bab33700e0c26aefe97b1f0c93fca4af677bd.tar.gz
dt-utils-949bab33700e0c26aefe97b1f0c93fca4af677bd.tar.xz
base64: remove unused variable
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 <u.oelmann@pengutronix.de> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-rw-r--r--src/base64.c15
1 files 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 <NUL>", 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);