3 ms·
snprintf(buf, 80, “%s”, argv[1]); Should work.
by fractalb 4y ago
snprintf(buf, 80, “%s”, argv[1]);
Should work.
- LoganDark 4y agoAs long as you replace the 'smart'-quotes with actual quotes. -Emily
- alxmdev 4y agoBingo, you should never pass arbitrary strings where they could be used as format specifiers, it's like running arbitrary code. Some compilers even issue warnings when you pass non-literal format strings to the printf family.