From 521d01e8ad87e931af3e9a763cc84a6cf7fe5ee3 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sun, 5 Dec 2021 09:47:21 -0800 Subject: Feat: basic string and memory functions Continue filling out the basic standard lib functions. Included prototypes of the str* and mem* families. Plan to add e(str|mem) and n(str|mem) variants as well. --- src/base/string/fit.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/base/string/fit.c') diff --git a/src/base/string/fit.c b/src/base/string/fit.c index 56ab041..23d4200 100644 --- a/src/base/string/fit.c +++ b/src/base/string/fit.c @@ -4,13 +4,14 @@ // buffer. if the capacity equals the length, then the function is a noop. the // byte array is unchanged. void -str·fit(string *s) +string·fit(string *s) { Hdr* h; - vlong cap = str·cap(*s); - vlong len = str·len(*s); + vlong cap = string·cap(*s); + vlong len = string·len(*s); - if (cap == len) return; + if(cap == len) + return; h = (Hdr*)(s - sizeof(Hdr)); h = realloc(h, sizeof(*h) + len + 1); -- cgit v1.2.1