Re:Parsing can become accidentally quadratic because of sscanf
by shawnz on Monday March 01, 2021 @12:49PM
(#26305649)
> ... doesn't mean will get N^2 behavior, unless you do silly things with sscanf, like extract a small token from the beginning of a large string, and then skip past it to do the same thing again after that small token: essentially, build a lexical analyzer in which the pattern matcher consists of calls to scanf. This is not an intended use case for sscanf.
Then why does it support the "%n" specifier? Isn't it exactly for that use case?
Then why does it support the "%n" specifier? Isn't it exactly for that use case?