NULL-Terminated Strings #4
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Telodendria/Cytoplasm#4
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
NULL-terminated strings are a source of many inefficiencies and potential vulnerabilities in C code. We should add a custom
Str
type that stores the length separately and has its own handling functions for concatenation and the like.This custom
Str
type should be Unicode aware. If that means it stores characters asuint32_t
, then so be it, although that isn't very memory-efficient in most cases.If we are going to go with a custom string type, we should also implement string interning so that #33 doesn't use up so much memory.
strlen
into a safer function #56