Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks, first I've heard of them and they happen to solve a real problem I'm working on today. Always nice when you can learn something new...


> Thanks, first I've heard of them and they happen to solve a real problem I'm working on today. Always nice when you can learn something new...

You don't really need to, TBH. I pretty much always wrote a malloc-memory `sprintf` alternative if the system didn't have one. it's only a few lines of code, that'll take maybe 10m of your day the first time you realise `sprintf` on the platform doesn't exist.

Here is a sample from more recently: https://github.com/lelanthran/libds/blob/b5289f6437b30139d42...


I know, that is what I was planning on doing. (and might be what I end up doing anyway since I need to truncate the utf-8 string if it is > 1024 bytes...) Still it is nice to have other options - this code is run in some tight loops so I will be profiling all the options.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: