> Yeah, that’s gonna take a while… To be fair I had no idea most sscanf implementations called strlen so I can’t blame the developer who wrote this. I would assume it just scanned byte by byte and could stop on a NULL.
Darn, I got the exact same issue ten years ago, with sscanf on Linux/glibc. The sscanf was forcing the huge XML mmaped file region to be entirely read.
The reason behind is that the glibc library was using some "smart" streams (to have generic functions for file/string streams, I guess) that basically all do strlen as first step to buildup this stream structure.
Darn, I got the exact same issue ten years ago, with sscanf on Linux/glibc. The sscanf was forcing the huge XML mmaped file region to be entirely read.
The reason behind is that the glibc library was using some "smart" streams (to have generic functions for file/string streams, I guess) that basically all do strlen as first step to buildup this stream structure.