From 5ac66dc387f93f10fba1f142e61637a48046fc73 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 4 Feb 2023 11:16:50 -0800 Subject: Rename cstring -> cstr. --- cstring/include/cstring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cstring/include/cstring.h b/cstring/include/cstring.h index b10514f..9425d51 100644 --- a/cstring/include/cstring.h +++ b/cstring/include/cstring.h @@ -18,7 +18,7 @@ \ static const size_t STRING##_size = SIZE; \ \ - static inline const char* STRING##_cstring(const STRING* str) { \ + static inline const char* STRING##_cstr(const STRING* str) { \ return str->str; \ } \ \ @@ -89,7 +89,7 @@ } \ \ static inline bool STRING##_eq_cstr(STRING a, const char* b) { \ - return strncmp(a.str, b, a.length) == 0; \ + return (a.length == strlen(b)) && strncmp(a.str, b, a.length) == 0; \ } DEF_STRING(sstring, 32) // Small. -- cgit v1.2.3