[hackers] [sbase][PATCH] base32, base16: fix bugs

From: Mattias Andrée <maandree_AT_kth.se>
Date: Tue, 29 Mar 2016 23:49:04 +0200

Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
---
 base16.c | 2 +-
 base32.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/base16.c b/base16.c
index 9940a02..1ea4132 100644
--- a/base16.c
+++ b/base16.c
_AT_@ -9,7 +9,7 @@
 #include "util.h"
 
 #define ALPHABET "0123456789ABCDEF"
-#define ALTALPHABET "0123456789ABCDEF"
+#define ALTALPHABET "0123456789abcdef"
 
 static unsigned char lut[256] =
 	ALPHABET ALPHABET ALPHABET ALPHABET ALPHABET ALPHABET ALPHABET ALPHABET
diff --git a/base32.c b/base32.c
index 49457e0..3d4ec14 100644
--- a/base32.c
+++ b/base32.c
_AT_@ -123,14 +123,14 @@ decode(FILE *fp)
 			if (value == 0xFF) {
 				if (*p == '=') {
 					if (++pads > 6)
-						eprintf("1 invalid input\n");
+						eprintf("invalid input\n");
 					value = 0;
 				} else if (*p == '\n') {
 					continue;
-				} else if (pads) {
-					eprintf("invalid input\n");
 				} else if (iflag) {
 					continue;
+				} else if (pads) {
+					eprintf("invalid input\n");
 				} else {
 					eprintf("invalid input\n");
 				}
-- 
2.7.4
Received on Tue Mar 29 2016 - 23:49:04 CEST

This archive was generated by hypermail 2.3.0 : Wed Mar 30 2016 - 00:00:36 CEST