Skip to content

Commit f94f402

Browse files
authored
Merge pull request #586 from Lastique/patch-1
Avoid initializing local char table when converting nibble to hex
2 parents 3ed0e36 + db4dc89 commit f94f402

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crypto/math/datatypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ static char bit_string[MAX_PRINT_STRING_LEN + 1];
6464

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

0 commit comments

Comments
 (0)