From: Fredrik Fornwall Date: Thu, 7 Jun 2018 23:09:56 +0000 (+0200) Subject: Fix build warning when chars are unsigned X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=b76ee39c67f83aae042ba2d16e05cb0c98e8185d;p=smdp.git Fix build warning when chars are unsigned Fix the following warning when chars are unsigned: viewer.c:988:25: warning: comparison of constant -1 with expression of type 'char' is always true [-Wtautological-constant-out-of-range-compare] while((c = getch()) != ERR) { --- diff --git a/src/viewer.c b/src/viewer.c index 20d496d..f0a1d99 100644 --- a/src/viewer.c +++ b/src/viewer.c @@ -982,7 +982,7 @@ int int_length (int val) { int get_slide_number(char init) { int retval = init - '0'; - char c; + int c; // block for tenths of a second when using getch, ERR if no input halfdelay(GOTO_SLIDE_DELAY); while((c = getch()) != ERR) {