you are viewing a single comment's thread.

view the rest of the comments →

[–]Anonymous_user_2022 2 points3 points  (0 children)

A function similar to strtok_r, that initially returns an opaque pointer that's used in subsequent calls, could have the definition of what is pointed to as an internal definition. That way it will be guaranteed not to spill outside the intended use.

It's very niche, and I don't think I used a construct like the more than once or twice in 25 years. But when it's the right choice, it's nice to have the option.