Fixed hex_to_string to display 'a' character properly.

This commit is contained in:
RoguePotato 2018-09-25 19:32:56 +01:00
parent 301019e838
commit c95d3c158e
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ void hex_to_ascii(int n, char str[]) {
tmp = (n >> i) & 0xF;
if (tmp == 0 && zeros == 0) continue;
zeros = 1;
if (tmp > 0xA) append(str, tmp - 0xA + 'a');
if (tmp >= 0xA) append(str, tmp - 0xA + 'a');
else append(str, tmp + '0');
}

View File

@ -29,7 +29,7 @@ void hex_to_ascii(int n, char str[]) {
tmp = (n >> i) & 0xF;
if (tmp == 0 && zeros == 0) continue;
zeros = 1;
if (tmp > 0xA) append(str, tmp - 0xA + 'a');
if (tmp >= 0xA) append(str, tmp - 0xA + 'a');
else append(str, tmp + '0');
}