Fix Error: keyboard_main.c:420:15: error: result of comparison of constant -1 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]

if (key != EOF)
          ~~~ ^  ~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-10-29 18:49:34 +08:00 committed by Petro Karashchenko
parent d52a8298ce
commit 1c23a095ea
2 changed files with 4 additions and 4 deletions

View File

@ -372,7 +372,7 @@ int main(int argc, FAR char *argv[])
{
int i;
int ret;
char key;
int key;
bool running = true;
pthread_t pid;
struct app_options appopt;
@ -416,7 +416,7 @@ int main(int argc, FAR char *argv[])
while (running)
{
key = (char)getchar();
key = getchar();
if (key != EOF)
{
switch (key)

View File

@ -502,7 +502,7 @@ int main(int argc, FAR char *argv[])
{
int i;
int ret;
char key;
int key;
bool running = true;
pthread_t pid;
struct app_options appopt;
@ -542,7 +542,7 @@ int main(int argc, FAR char *argv[])
while (running)
{
key = (char)getchar();
key = getchar();
if (key != EOF)
{
switch (key)