summaryrefslogtreecommitdiff
path: root/toxdns/toxdns.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-05-01 16:05:59 -0400
committerirungentoo <irungentoo@gmail.com>2015-05-01 16:05:59 -0400
commit6da97bb48a69b1290667067d073d0b7f79967f47 (patch)
tree79423205217e1e233d511e1564d46718afafadf9 /toxdns/toxdns.c
parentbd67129c3e532a97d13c7ed04541ecefc395ab5a (diff)
Fixed some non standard C.
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);