Fix build warning when chars are unsigned
authorFredrik Fornwall <fredrik@fornwall.net>
Thu, 7 Jun 2018 23:09:56 +0000 (01:09 +0200)
committerFredrik Fornwall <fredrik@fornwall.net>
Thu, 7 Jun 2018 23:09:56 +0000 (01:09 +0200)
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) {

src/viewer.c

index 20d496d..f0a1d99 100644 (file)
@@ -982,7 +982,7 @@ int int_length (int val) {
 
 int get_slide_number(char init) {
     int retval = init - '0';
 
 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) {
     // block for tenths of a second when using getch, ERR if no input
     halfdelay(GOTO_SLIDE_DELAY);
     while((c = getch()) != ERR) {