Skip to content

Commit fae8566

Browse files
authored
Merge pull request #18 from Dazza0/fix/unused_str_if_no_output
fix: unused variable warning when output is disabled
2 parents debd3ad + 2938bec commit fae8566

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lwshell/src/lwshell/lwshell.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ prv_parse_input(lwshell_t* lwobj) {
9393
size_t s_len;
9494
char* str;
9595

96-
/*
96+
/*
9797
* Check string length and compare with buffer pointer
9898
* Must be more than `1` character since we have to include end of line
9999
*/
@@ -345,8 +345,10 @@ lwshell_input_ex(lwshell_t* lwobj, const void* in_data, size_t len) {
345345
break;
346346
}
347347
default: {
348+
#if LWSHELL_CFG_USE_OUTPUT
348349
char str[2] = {p_data[idx], 0};
349350
LWSHELL_OUTPUT(lwobj, str);
351+
#endif /* LWSHELL_CFG_USE_OUTPUT */
350352
if (p_data[idx] >= 0x20 && p_data[idx] < 0x7F) {
351353
LWSHELL_ADD_CH(lwobj, p_data[idx]);
352354
}

0 commit comments

Comments
 (0)