]> 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)
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
selftest/knownfail.d/test_ms_fn_match_protocol_no_wildcard [new file with mode: 0644]

index 1650c9b82321b4da3bbfa58d15937ea5590c70b4..bd9cd6e69f508320f502cad439b16a83b4a5fab2 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