Skip to content

Commit 7cbe3b5

Browse files
committed
Guard n_args variable with CIRCUITPY_TERMINALIO_VT100 flag
1 parent 9820c85 commit 7cbe3b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shared-module/terminalio/Terminal.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
115115
} else if (c == 0x1b) {
116116
// Handle commands of the form [ESC].<digits><command-char> where . is not yet known.
117117
uint8_t vt_args[3] = {0, -1, -1};
118-
uint8_t n_args = 1;
119118
uint8_t j = 1;
119+
#if CIRCUITPY_TERMINALIO_VT100
120+
uint8_t n_args = 1;
121+
#endif
120122
for (; j < 6; j++) {
121123
if ('0' <= i[j] && i[j] <= '9') {
122124
vt_args[0] = vt_args[0] * 10 + (i[j] - '0');
@@ -131,7 +133,9 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con
131133
for (++j; j < 12; j++) {
132134
if ('0' <= i[j] && i[j] <= '9') {
133135
vt_args[i_args] = vt_args[i_args] * 10 + (i[j] - '0');
136+
#if CIRCUITPY_TERMINALIO_VT100
134137
n_args = i_args + 1;
138+
#endif
135139
} else {
136140
c = i[j];
137141
break;

0 commit comments

Comments
 (0)