Skip to content

Commit

Permalink
misc: fix hex2char reverse.
Browse files Browse the repository at this point in the history
  • Loading branch information
ysc3839 authored and updateing committed Jan 13, 2019
1 parent 5ef1fa6 commit 3bdba55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ uint8_t char2hex(const char* str) {

void hex2char(uint8_t hex, char* out) {
#define HEX2LOWER(digit) (((digit) >= 0xa) ? ((digit) - 0xa + 'a') : ((digit) + '0'))
out[0] = HEX2LOWER(hex & 0xf);
out[1] = HEX2LOWER((hex & 0xf0) >> 4);
out[0] = HEX2LOWER((hex & 0xf0) >> 4);
out[1] = HEX2LOWER(hex & 0xf);
}

char* my_itoa(int val, char* buf, uint32_t radix) {
Expand Down

0 comments on commit 3bdba55

Please sign in to comment.