Skip to content

Commit 8c230ba

Browse files
authored
Merge pull request #2445 from misonyo/patch-1
[components/shell] shell will not work if ch is none zero as random value in stack
2 parents a0df6be + 14e048a commit 8c230ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/finsh/shell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static int finsh_getchar(void)
139139
#ifdef RT_USING_POSIX
140140
return getchar();
141141
#else
142-
int ch;
142+
int ch = 0;
143143

144144
RT_ASSERT(shell != RT_NULL);
145145
while (rt_device_read(shell->device, -1, &ch, 1) != 1)

0 commit comments

Comments
 (0)