diff options
author | 3gg <3gg@shellblade.net> | 2023-02-04 11:16:50 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2023-02-04 11:16:50 -0800 |
commit | 5ac66dc387f93f10fba1f142e61637a48046fc73 (patch) | |
tree | 05bd97a19b1853aa1a696541c083444a74778fea /cstring | |
parent | 470a25323ca89ffa3b0b697aeddcf184d12a1382 (diff) |
Rename cstring -> cstr.
Diffstat (limited to 'cstring')
-rw-r--r-- | cstring/include/cstring.h | 4 |
1 files 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 @@ | |||
18 | \ | 18 | \ |
19 | static const size_t STRING##_size = SIZE; \ | 19 | static const size_t STRING##_size = SIZE; \ |
20 | \ | 20 | \ |
21 | static inline const char* STRING##_cstring(const STRING* str) { \ | 21 | static inline const char* STRING##_cstr(const STRING* str) { \ |
22 | return str->str; \ | 22 | return str->str; \ |
23 | } \ | 23 | } \ |
24 | \ | 24 | \ |
@@ -89,7 +89,7 @@ | |||
89 | } \ | 89 | } \ |
90 | \ | 90 | \ |
91 | static inline bool STRING##_eq_cstr(STRING a, const char* b) { \ | 91 | static inline bool STRING##_eq_cstr(STRING a, const char* b) { \ |
92 | return strncmp(a.str, b, a.length) == 0; \ | 92 | return (a.length == strlen(b)) && strncmp(a.str, b, a.length) == 0; \ |
93 | } | 93 | } |
94 | 94 | ||
95 | DEF_STRING(sstring, 32) // Small. | 95 | DEF_STRING(sstring, 32) // Small. |