logoalt Hacker News

gizmo686today at 3:54 AM1 replyview on HN

C strings also allow you to do a 0 copy split by replacing all instances of the delimeter with null (although you need to keep track of the end-of-list seperatly).


Replies

masklinntoday at 4:59 AM

You also need to own the buffer otherwise you’re corrupting someone else’s data, or straight up segfaulting.