summaryrefslogtreecommitdiff
path: root/toxdns/toxdns.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxdns/toxdns.c')
-rw-r--r--toxdns/toxdns.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/toxdns/toxdns.c b/toxdns/toxdns.c
index 186ea82b..f7df5df3 100644
--- a/toxdns/toxdns.c
+++ b/toxdns/toxdns.c
@@ -160,25 +160,14 @@ static int decode(uint8_t *dest, uint8_t *src)
160 while (*p) { 160 while (*p) {
161 uint8_t ch = *p++; 161 uint8_t ch = *p++;
162 162
163 switch (ch) { 163 if ('A' <= ch && ch <= 'Z') {
164 case 'A' ... 'Z': { 164 ch = ch - 'A';
165 ch = ch - 'A'; 165 } else if ('a' <= ch && ch <= 'z') {
166 break; 166 ch = ch - 'a';
167 } 167 } else if ('0' <= ch && ch <= '5') {
168 168 ch = ch - '0' + 26;
169 case 'a' ... 'z': { 169 } else {
170 ch = ch - 'a'; 170 return - 1;
171 break;
172 }
173
174 case '0' ... '5': {
175 ch = ch - '0' + 26;
176 break;
177 }
178
179 default: {
180 return - 1;
181 }
182 } 171 }
183 172
184 *op |= (ch << bits); 173 *op |= (ch << bits);