瀏覽代碼

[finsh] Fix the C99 issue.

bernard 7 年之前
父節點
當前提交
3c0fbf0c7e
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      components/finsh/shell.c

+ 1 - 2
components/finsh/shell.c

@@ -84,13 +84,12 @@ const char *finsh_get_prompt()
 
 static char finsh_getchar(void)
 {
-    RT_ASSERT(shell != RT_NULL);
-
 #ifdef RT_USING_POSIX_STDIN
     return getchar();
 #else
     char ch;
 
+    RT_ASSERT(shell != RT_NULL);
     while (rt_device_read(shell->device, -1, &ch, 1) != 1)
         rt_sem_take(&shell->rx_sem, RT_WAITING_FOREVER);