Source: nn
Version: 6.7.3-14
Severity: normal
Tags: patch

Dear Maintainer,

>From c85762385f0b489bc2dc5c57b2f6ce1811bae6f4 Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Sat, 13 Mar 2021 21:03:57 +0000
>Subject: [PATCH] match.c: cast a character to an int for comparison with the 
>function
> "tolower"

match.c:61:48: warning: comparison of integer expressions of different 
signedness: 'int' and 'unsigned int' [-Wsign-compare]
   61 |  if (!isascii(c) || !isupper(c) || _tolower(c) != (unsigned) d)
      |                                                ^~

Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 match.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/match.c b/match.c
index 8eadbeb..6f1969b 100644
--- a/match.c
+++ b/match.c
@@ -65,10 +65,10 @@ streq_fold(register char *mask, register char *str)
            continue;
 
 #ifdef _tolower
-       if (!isascii(c) || !isupper(c) || _tolower(c) != (unsigned) d)
+       if (!isascii(c) || !isupper(c) || _tolower(c) != (int) d)
            return 0;
 #else
-       if (tolower(c) != d)
+       if (tolower(c) != (int) d)
            return 0;
 #endif
     }
@@ -88,10 +88,10 @@ strmatch_fold(char *mask, register char *str)
 #ifdef _tolower
            if (!isascii(c) || !isupper(c))
                continue;
-           if (_tolower(c) == (unsigned) m1)
+           if (_tolower(c) == (int) m1)
                break;
 #else
-           if (tolower(c) == m1)
+           if (tolower(c) == (int) m1)
                break;
 #endif
        }
-- 
2.30.1



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.19-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

-- debconf information excluded

-- 
Bjarni I. Gislason

Reply via email to