diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/numconvert.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/numconvert.c b/src/numconvert.c index b852194..e7b3a8c 100644 --- a/src/numconvert.c +++ b/src/numconvert.c | |||
| @@ -288,13 +288,10 @@ int main(int argc, char * argv[]) | |||
| 288 | optbase = 8; | 288 | optbase = 8; |
| 289 | else | 289 | else |
| 290 | { | 290 | { |
| 291 | for(y = 0; ( ((uint32_t)y) < strlen(argv[x]) && (optbase != -1) ); y++) | 291 | optbase = 10; |
| 292 | { | 292 | for(y = 0; ( ((uint32_t)y) < strlen(argv[x]) && (optbase == 10) ); y++) |
| 293 | if ( (optbase < 10) && ((argv[x][y] >= '0') && (argv[x][y] <= '9')) ) optbase = 10; | 293 | if ((argv[x][y] < '0') || (argv[x][y] > '9')) |
| 294 | else if ( (optbase < 16) && ((argv[x][y] >= 'a') && (argv[x][y] <= 'f')) ) optbase = 16; | 294 | optbase = -1; |
| 295 | else if ( (optbase < 16) && ((argv[x][y] >= 'a') && (argv[x][y] <= 'F')) ) optbase = 16; | ||
| 296 | else optbase = -1; | ||
| 297 | }; | ||
| 298 | }; | 295 | }; |
| 299 | }; | 296 | }; |
| 300 | 297 | ||
