← Back to context

Comment by ufo

5 years ago

Oh dear... that's one of the biggest footguns I've ever seen in all my years of working with C.

It is! Not mentioned anywhere in the manpages either & there’s no a priori reason for sscanf() to need to call strlen() on the input string, so most programmers would never expect it to.

Pretty sure I would have made this error in the same situation, no question.