aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/c_strings.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-12 14:05:22 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-12 14:05:22 -0400
commit3cd3b20f58e9d2c6463d503be09e5d4cfaadee6c (patch)
tree9b7120a4969a38793ecff3aab549b463c7dcf822 /src/stdlib/c_strings.c
parentbd190ac0a84eefa3174c04ce1fe2059aed6f2d1b (diff)
Code cleanup and fixing minor issues
Diffstat (limited to 'src/stdlib/c_strings.c')
-rw-r--r--src/stdlib/c_strings.c3
1 files changed, 2 insertions, 1 deletions
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) {