]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
util:charset:util_str: use NUMERIC_CMP in strcasecmp_m_handle
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 3 Apr 2024 02:49:55 +0000 (15:49 +1300)
committerJule Anger <janger@samba.org>
Mon, 10 Jun 2024 13:25:16 +0000 (13:25 +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>
(cherry picked from commit f788a399996a73b2aa206ec2b15f5943b06660e0)

lib/util/charset/util_str.c
selftest/knownfail.d/test_ms_fn_match_protocol_no_wildcard [new file with mode: 0644]

index 5d415f097e4a92ee47f0f29fd63ed34f7e8528a2..04d69dfb4288d301b50da2285d26d8b85221ef26 100644 (file)
@@ -26,6 +26,7 @@
 #include "system/locale.h"
 #include "charset.h"
 #include "lib/util/fault.h"
+#include "lib/util/tsort.h"
 
 #ifdef strcasecmp
 #undef strcasecmp
@@ -79,10 +80,10 @@ _PUBLIC_ int strcasecmp_m_handle(struct smb_iconv_handle *iconv_handle,
                        continue;
                }
 
-               return l1 - l2;
+               return NUMERIC_CMP(l1, l2);
        }
 
-       return *s1 - *s2;
+       return NUMERIC_CMP(*s1, *s2);
 }
 
 /**
diff --git a/selftest/knownfail.d/test_ms_fn_match_protocol_no_wildcard b/selftest/knownfail.d/test_ms_fn_match_protocol_no_wildcard
new file mode 100644 (file)
index 0000000..fe0d14e
--- /dev/null
@@ -0,0 +1 @@
+^samba.unittests.ms_fnmatch.test_ms_fn_match_protocol_no_wildcard