aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/tests/string
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2024-11-20 16:47:35 +0000
committerEd Maste <emaste@FreeBSD.org>2025-09-13 19:30:31 +0000
commite0eaabb80d1724acf88f04acbc2ca13d42270863 (patch)
treed15178bff4f89b8b722bb39a4c32c61472f13456 /lib/libc/tests/string
parentcab4cf201acf76b415a8f1a59ea4eeeb14b4636c (diff)
Diffstat (limited to 'lib/libc/tests/string')
-rw-r--r--lib/libc/tests/string/memcmp_test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/tests/string/memcmp_test.c b/lib/libc/tests/string/memcmp_test.c
index 5286a0b994f3..fa2f498ccfaf 100644
--- a/lib/libc/tests/string/memcmp_test.c
+++ b/lib/libc/tests/string/memcmp_test.c
@@ -41,14 +41,14 @@
#endif
/*
- * On FreeBSD we demand that memcmp returns the difference between the
- * characters at the first site of mismatch. However, ISO/IEC 9899:1990
- * only specifies that a number greater than, equal to, or less than
- * zero shall be returned. If a unit test for this less strict
- * behaviour is desired, define RES(x) to be (((x) > 0) - ((x) < 0)).
+ * On FreeBSD we previously demanded that memcmp returns the difference
+ * between the characters at the first site of mismatch. However,
+ * ISO/IEC 9899:1990 only specifies that a number greater than, equal
+ * to, or less than zero shall be returned. If a unit test for the
+ * more strict behaviour is desired, define RES(x) to be (x).
*/
#ifndef RES
-#define RES(x) (x)
+#define RES(x) (((x) > 0) - ((x) < 0))
#endif
static int (*memcmp_fn)(const void *, const void *, size_t);