diff options
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/hexedit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/miscutils/hexedit.c b/miscutils/hexedit.c index bdb7683f2..1d683b7de 100644 --- a/miscutils/hexedit.c +++ b/miscutils/hexedit.c | |||
| @@ -274,7 +274,7 @@ int hexedit_main(int argc UNUSED_PARAM, char **argv) | |||
| 274 | 274 | ||
| 275 | for (;;) { | 275 | for (;;) { |
| 276 | unsigned cnt; | 276 | unsigned cnt; |
| 277 | int32_t key = key; // for compiler | 277 | int32_t key = key; /* for compiler */ |
| 278 | uint8_t byte; | 278 | uint8_t byte; |
| 279 | 279 | ||
| 280 | fflush_all(); | 280 | fflush_all(); |
| @@ -286,11 +286,12 @@ int hexedit_main(int argc UNUSED_PARAM, char **argv) | |||
| 286 | key = CTRL('X'); | 286 | key = CTRL('X'); |
| 287 | 287 | ||
| 288 | cnt = 1; | 288 | cnt = 1; |
| 289 | if ((unsigned)(key - 'A') <= 'Z' - 'A') | ||
| 290 | key |= 0x20; /* convert A-Z to a-z */ | ||
| 289 | switch (key) { | 291 | switch (key) { |
| 290 | case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': | ||
| 291 | case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': | 292 | case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': |
| 292 | /* lowercase, then convert to '0'+10...15 */ | 293 | /* convert to '0'+10...15 */ |
| 293 | key = (key | 0x20) - ('a' - '0' - 10); | 294 | key = key - ('a' - '0' - 10); |
| 294 | /* fall through */ | 295 | /* fall through */ |
| 295 | case '0': case '1': case '2': case '3': case '4': | 296 | case '0': case '1': case '2': case '3': case '4': |
| 296 | case '5': case '6': case '7': case '8': case '9': | 297 | case '5': case '6': case '7': case '8': case '9': |
