From 3cd3b20f58e9d2c6463d503be09e5d4cfaadee6c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 12 Oct 2025 14:05:22 -0400 Subject: Code cleanup and fixing minor issues --- src/stdlib/c_strings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/stdlib/c_strings.c') diff --git a/src/stdlib/c_strings.c b/src/stdlib/c_strings.c index 2946ce58..54ea1e40 100644 --- a/src/stdlib/c_strings.c +++ b/src/stdlib/c_strings.c @@ -28,7 +28,8 @@ PUREFUNC public int32_t CString$compare(const void *x, const void *y, const Type if (!*(const char **)x != !*(const char **)y) return (!*(const char **)y) - (!*(const char **)x); - return strcmp(*(const char **)x, *(const char **)y); + const char *x_str = *(const char **)x, *y_str = *(const char **)y; + return (x_str == NULL) || (y_str == NULL) ? (x_str != NULL) - (y_str != NULL) : strcmp(x_str, y_str); } PUREFUNC public bool CString$equal(const void *x, const void *y, const TypeInfo_t *type) { -- cgit v1.2.3