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

Dear Maintainer,

>From 31b27501562ac5c96b62e290afcf2a35679d936d Mon Sep 17 00:00:00 2001
>From: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
>Date: Fri, 5 Mar 2021 23:02:04 +0000
>Subject: [PATCH] regexp.c: cast an int to size_t in a comparison

regexp.c:275:52: warning: comparison of integer expressions of different 
signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  275 |   if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) {
      |                                                    ^~

Signed-off-by: Bjarni Ingi Gislason <bjarn...@rhi.hi.is>
---
 regexp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/regexp.c b/regexp.c
index 0a08534..316743e 100644
--- a/regexp.c
+++ b/regexp.c
@@ -272,7 +272,8 @@ regcomp(char *exp)
            longest = NULL;
            len = 0;
            for (; scan != NULL; scan = regnext(scan))
-               if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) {
+               if (OP(scan) == EXACTLY && strlen(OPERAND(scan))
+                   >= (size_t) len) {
                    longest = OPERAND(scan);
                    len = strlen(OPERAND(scan));
                }
-- 
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.9-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