diff options
Diffstat (limited to 'cstring/include')
-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. |