hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 799dbfacff51c7d0dde225ce2a174f6846115112
parent 0173fccbb92e5cbed8bc8839a23b5946b8865031
Author: Sebastian <sebastian@sebsite.pw>
Date:   Mon, 28 Mar 2022 21:04:39 -0400

strings: account for NUL-terminator in fromc capacity

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mstrings/cstrings.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/strings/cstrings.ha b/strings/cstrings.ha @@ -21,7 +21,7 @@ export fn fromc_unsafe(cstr: *const char) const str = { const s = types::string { data = cstr: *[*]u8, length = l, - capacity = l, + capacity = l + 1, }; return *(&s: *const str); };