From b4d6cf3e4352d20ac0cb1aa948456d31bd0e0589 Mon Sep 17 00:00:00 2001 From: Aoran Zeng Date: Sat, 8 Jun 2024 15:32:31 +0800 Subject: [PATCH] Fix `xy_streql` when NULL --- include/xy.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/xy.h b/include/xy.h index c08f6cd..52e5ae7 100644 --- a/include/xy.h +++ b/include/xy.h @@ -292,6 +292,10 @@ _xy_str_to_terminal_style (int style, const char *str) static bool xy_streql (const char *str1, const char *str2) { + if (NULL==str1 || NULL==str2) + { + return false; + } return strcmp (str1, str2) == 0 ? true : false; }