Thanks for mentioning this. I didn't include it in my comment because I originally thought it was too obvious, but considering it now, it probably was worth making explicit.
I blame Stack Overflow for conditioning me into seeing more of the possible ways things could break, when it comes to C code. :)
`-Wformat-security` [0] to the rescue!
Instead, if you want to use `snprintf()` for this, remember to do:
[1]: https://linux.die.net/man/3/snprintf