4 ms·
So if I understand is the issue not that sscanf reads the whole string length, but that people call sscanf multiple times on the same string for each value they
by arduinomancer 6y ago
So if I understand is the issue not that sscanf reads the whole string length, but that people call sscanf multiple times on the same string for each value they want to parse?
Meaning sscanf is actually designed to scan all your values in one pass?
- JdeBP 6y agoIt isn't designed that way, no. This is simply an internal choice made by C library implementors, and one implementation choice fares very badly in this situation, as the strings grow long. The other choice is pretty much immune to long strings in these scenarios. You cannot infer from this an intended usage of sscanf(), because this issue isn't part of the interface contract, just an effect of a particular implementation.