That's however relatively easy to verify programmatically, and indeed any recent compiler will complain about that.
I'd say the usual trap is rather the size of the target buffer, because that requires bigger static analysis guns. (I'm ignoring things like "%n", because then you're playing with fire already.)