diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-08 16:27:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-08 16:27:04 +0000 |
commit | a836a244a3d2bdd4da1ee2641e3e957850668cea (patch) | |
tree | cb87c75b3677fab7144f868435243f864048a1e6 /libnetdata/string/string.c | |
parent | Adding upstream version 1.38.1. (diff) | |
download | netdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.tar.xz netdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.zip |
Adding upstream version 1.39.0.upstream/1.39.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | libnetdata/string/string.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libnetdata/string/string.c b/libnetdata/string/string.c index 4e232523c..9385aa6e8 100644 --- a/libnetdata/string/string.c +++ b/libnetdata/string/string.c @@ -300,16 +300,20 @@ void string_freez(STRING *string) { string_stats_atomic_increment(releases); } -size_t string_strlen(STRING *string) { +inline size_t string_strlen(STRING *string) { if(unlikely(!string)) return 0; return string->length - 1; } -const char *string2str(STRING *string) { +inline const char *string2str(STRING *string) { if(unlikely(!string)) return ""; return string->str; } +int string_strcmp(STRING *string, const char *s) { + return strcmp(string2str(string), s); +} + STRING *string_2way_merge(STRING *a, STRING *b) { static STRING *X = NULL; |