News for hackers. Stuff that matters.
Re:String tokenization in C by agumonkey on Saturday December 15, 2018 @08:08AM (#18688243)
any attempt has been made to build a nicer foundational C/OS library since ?
Re:String tokenization in C by jstimpfle on Saturday December 15, 2018 @08:15AM (#18688265)
There are of course tons of code on the net, but there is no need to standardize another grab-bag of bad API calls. If you need a batteries-included library you use python or similar. If you write in C, you care so much that you largely avoid the standard library and design your code from the ground up.
Re:String tokenization in C by Matthias247 on Saturday December 15, 2018 @12:12PM (#18689212)
You should. However there are lots of organizations around that use C because that’s what’s used in their domain (E.g. embedded) AND use the standard library, because they don’t know how to do better.

The results are often worse than if they would have used a higher level language right from the start.

Re:String tokenization in C by dkrikun on Saturday December 15, 2018 @10:59AM (#18688859)
There are numerous reasons to write in C, apart from caring so much. Using strtok() is not that bad after all because its a simple function after all.
Re:String tokenization in C by nly on Saturday December 15, 2018 @08:12AM (#18688253)
BSD has some minor improvements to libc. There's also glib.

Generally though, C is just a terrible language to do anything other than write extremely low level routines in. You should probably just never use strtok() and go straight to something like Ragel or re2c for building high performance tokenizers... then call those from a higher level language.

Re:String tokenization in C by yakovdk on Saturday December 15, 2018 @12:21PM (#18689252)
Hey! I take exception to that. I've been writing shellcode all week. C is uncomfortably high level for writing low level routines!