util: charset:util_str: use NUMERIC_CMP in strncasecmp_m_handle
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 3 Apr 2024 03:16:44 +0000 (16:16 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Apr 2024 22:56:33 +0000 (22:56 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/charset/util_str.c

index bd9cd6e69f508320f502cad439b16a83b4a5fab2..c52b77384ceedbeb953de0aa085ede3842fbca4d 100644 (file)
@@ -157,14 +157,14 @@ _PUBLIC_ int strncasecmp_m_handle(struct smb_iconv_handle *iconv_handle,
                        continue;
                }
 
-               return l1 - l2;
+               return NUMERIC_CMP(l1, l2);
        }
 
        if (n == 0) {
                return 0;
        }
 
-       return *s1 - *s2;
+       return NUMERIC_CMP(*s1, *s2);
 }
 
 /**