Mercurial > pidgin
comparison libpurple/util.c @ 16153:6613fb7af427
Call strtolower() so that we don't have to check against the
capital versions of these letters
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 15 Apr 2007 18:51:11 +0000 |
parents | a5a831a5f186 |
children | 49a1fed5ee37 |
comparison
equal
deleted
inserted
replaced
16152:a740afef2daf | 16153:6613fb7af427 |
---|---|
132 | 132 |
133 if (isdigit(str[i])) | 133 if (isdigit(str[i])) |
134 accumulator |= str[i] - 48; | 134 accumulator |= str[i] - 48; |
135 else | 135 else |
136 { | 136 { |
137 switch(str[i]) | 137 switch(tolower(str[i])) |
138 { | 138 { |
139 case 'a': case 'A': accumulator |= 10; break; | 139 case 'a': accumulator |= 10; break; |
140 case 'b': case 'B': accumulator |= 11; break; | 140 case 'b': accumulator |= 11; break; |
141 case 'c': case 'C': accumulator |= 12; break; | 141 case 'c': accumulator |= 12; break; |
142 case 'd': case 'D': accumulator |= 13; break; | 142 case 'd': accumulator |= 13; break; |
143 case 'e': case 'E': accumulator |= 14; break; | 143 case 'e': accumulator |= 14; break; |
144 case 'f': case 'F': accumulator |= 15; break; | 144 case 'f': accumulator |= 15; break; |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 if (i % 2) | 148 if (i % 2) |
149 data[(i - 1) / 2] = accumulator; | 149 data[(i - 1) / 2] = accumulator; |