Rev 601 | Rev 607 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 601 | Rev 603 | ||
---|---|---|---|
Line 138... | Line 138... | ||
138 | text += 2; |
138 | text += 2; |
139 | } else if (text[0] == '0') |
139 | } else if (text[0] == '0') |
140 | base = 8; |
140 | base = 8; |
141 | 141 | ||
142 | while (*text) { |
142 | while (*text) { |
- | 143 | if (base != 16 && \ |
|
143 | if (base != 16 && *text >= 'A' && *text <= 'F') |
144 | ((*text >= 'A' && *text <= 'F' ) |
- | 145 | || (*text >='a' && *text <='f'))) |
|
144 | break; |
146 | break; |
145 | if (base == 8 && *text >='8') |
147 | if (base == 8 && *text >='8') |
146 | break; |
148 | break; |
147 | 149 | ||
148 | if (*text >= '0' && *text <= '9') { |
150 | if (*text >= '0' && *text <= '9') { |
149 | result *= base; |
151 | result *= base; |
150 | result += *text - '0'; |
152 | result += *text - '0'; |
151 | } else if (*text >= 'A' && *text <= 'F') { |
153 | } else if (*text >= 'A' && *text <= 'F') { |
152 | result *= base; |
154 | result *= base; |
153 | result += *text - 'A' + 10; |
155 | result += *text - 'A' + 10; |
- | 156 | } else if (*text >= 'a' && *text <= 'f') { |
|
- | 157 | result *= base; |
|
- | 158 | result += *text - 'a' + 10; |
|
154 | } else |
159 | } else |
155 | break; |
160 | break; |
156 | text++; |
161 | text++; |
157 | } |
162 | } |
158 | 163 |