10 Replies
Probably missing the null terminator
do you mean String's init is not adding it?
My guess is that the span is being converted to a list, and that’s being used for the string construction. If that Span’s last element is not a null terminator, then you’d see the clipping that you are now
Try constructing a list from the span, and append a 0 to it. Then create the string from that list
lol ok
I don’t like the null terminator shenanigans for strings either lol
I mean, regardless of that, it should be automated
but yeah...
yep, appending 0 works
gonna dust off the PDP-11
Yeah, automating it would be nice. I’ve shot myself in the foot plenty of times while missing the null terminator
so making a string slice doesn't need the append
@toasty good catch, thanks!
Yeah! I try to use string slice where I can too
a safe version would be really useful