Skip to content

Commit caf20e7

Browse files
committed
Fix minimal-printf stack overflow
1 parent 745a4b4 commit caf20e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platform/source/minimal-printf/mbed_printf_implementation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ static void mbed_minimal_formatted_string_hexadecimal(char *buffer, size_t lengt
220220
unsigned int nibble_one = (output >> 4);
221221
unsigned int nibble_two = (output & 0x0F);
222222

223-
const char int2hex_lower[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
223+
static const char int2hex_lower[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
224224
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
225225
};
226-
const char int2hex_upper[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
226+
static const char int2hex_upper[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
227227
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
228228
};
229229
const char *int2hex = upper ? int2hex_upper : int2hex_lower;

0 commit comments

Comments
 (0)