summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-10-19 10:45:34 -0400
committerpommicket <pommicket@gmail.com>2023-10-19 10:45:34 -0400
commit69d702f2076930b8cc88c73420fc849eb4b807ce (patch)
tree41547166457ba5b0710f077f98eba3ae37872404 /util.c
parent30f37caf7d9facf7698d01ef77d7da93e7316103 (diff)
editorconfig seems to be working
Diffstat (limited to 'util.c')
-rw-r--r--util.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/util.c b/util.c
index 2e702e2..98c7dbc 100644
--- a/util.c
+++ b/util.c
@@ -54,10 +54,14 @@ void rc_str_decref(RcStr **pstr) {
}
}
-const char *rc_str(RcStr *str, const char *default_value) {
- if (!str) return default_value;
- assert(str->ref_count > 0);
- return str->str;
+const char *rc_str(RcStr *s, const char *default_value) {
+ if (!s) return default_value;
+ assert(s->ref_count > 0);
+ return s->str;
+}
+
+size_t rc_str_len(RcStr *s) {
+ return strlen(rc_str(s, ""));
}
bool is32_word(char32_t c) {