News for hackers. Stuff that matters.
Re:C Strings and my slow descent to madness by fractalb on Thursday April 06, 2023 @11:39PM (#35477760)

    snprintf(buf, 80, “%s”, argv[1]);
Should work.
Re:C Strings and my slow descent to madness by LoganDark on Friday April 07, 2023 @09:53AM (#35481559)
As long as you replace the 'smart'-quotes with actual quotes.

-Emily

Re:C Strings and my slow descent to madness by alxmdev on Friday April 07, 2023 @01:38PM (#35484424)
Bingo, 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.