PS: Yes, I know, if it would be a web api, I'd need to do play the same games with strings there.
But there it's at least obvious why it is needed (and it would also be less tedious in a modern scripting language, compared to dealing with string in raw C).
Again, I'm not really complaining. I'm just wondering whether one would still solve it in the same today in a brand new OS.