Re:Parsing can become accidentally quadratic because of sscanf
by cormacrelf on Monday March 01, 2021 @08:58PM
(#26311036)
It probably shouldn’t involve writing your own string functions. They’re so hard to get right, obviously. Last time I wrote C, I copied out the Rust Vec and String API as C headers and didn’t quite nail the implementation, but it was fun.
There are at least a few libs like sds that store the length information in various ways, which solves at least this kind of problem.
There are at least a few libs like sds that store the length information in various ways, which solves at least this kind of problem.
https://github.com/antirez/sds