Merge pull request #2445 from misonyo/patch-1

[components/shell] shell will not work if ch is none zero as random value in stack
This commit is contained in:
Bernard Xiong 2019-03-14 09:03:58 +08:00 committed by GitHub
commit 8c230ba16a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ static int finsh_getchar(void)
#ifdef RT_USING_POSIX #ifdef RT_USING_POSIX
return getchar(); return getchar();
#else #else
int ch; int ch = 0;
RT_ASSERT(shell != RT_NULL); RT_ASSERT(shell != RT_NULL);
while (rt_device_read(shell->device, -1, &ch, 1) != 1) while (rt_device_read(shell->device, -1, &ch, 1) != 1)