Skip to content

Commit

Permalink
Merge pull request #586 from Lastique/patch-1
Browse files Browse the repository at this point in the history
Avoid initializing local char table when converting nibble to hex
  • Loading branch information
pabuhler authored Dec 11, 2021
2 parents 3ed0e36 + db4dc89 commit f94f402
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypto/math/datatypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ static char bit_string[MAX_PRINT_STRING_LEN + 1];

uint8_t srtp_nibble_to_hex_char(uint8_t nibble)
{
char buf[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
static const char buf[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
return buf[nibble & 0xF];
}

Expand Down

0 comments on commit f94f402

Please sign in to comment.