hare

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

commit 14ea72134d7ad21c53f2ea8f98e2bba77f2835c7
parent 744272c30230d9c56917109e186c4a8fbae4326c
Author: Sebastian <sebastian@sebsite.pw>
Date:   Tue, 23 Jan 2024 15:57:09 -0500

types::c: minor fix for unterminatedstr docs

In C, a string is defined as a sequence of bytes terminated by a NUL
byte, so by definition unterminatedstr doesn't return a C string (unless
the Hare string is NUL-terminated).

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

Diffstat:
Mtypes/c/strings.ha | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/types/c/strings.ha b/types/c/strings.ha @@ -78,9 +78,9 @@ export fn nulstr(s: const str) *const char = { return s.data: *const char; }; -// Converts a non-NUL-terminated Hare string to a C string. The return value is -// borrowed from the input, except in the case of an empty string, in which case -// it is statically allocated. +// Converts a non-NUL-terminated Hare string to a *const [[char]]. The return +// value is borrowed from the input, except in the case of an empty string, in +// which case it is statically allocated. // // Use with caution! export fn unterminatedstr(s: const str) *const char = {