The answer of unwind to my previous question leaded me another question. I used to ask question about
const char *INTERFACE = "wlan0"; struct ifreq ifr; memset(&ifr, 0, sizeof(ifr)); snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), INTERFACE); unwind replied as
It's worth warning for since it can be a security risk, if the string argument is changable at runtime it's possible that a % can be "snuck in", which will lead to problems. Therefore it's better if the formatting string is hardcoded to "do what you want".
I wonder how is it possible to change the string argument on the runtime?
EDIT: to be clearer, could anyone give me an example how to change the string argument on the runtime?