jmoon018 / PacVim

GNU Lesser General Public License v3.0
3.25k stars 193 forks source link

pacvim: always use "%s"-style format for printf()-style functions #53

Open trofi opened 3 years ago

trofi commented 3 years ago

ncuses-6.3 added printf-style function attributes and now makes it easier to catch cases when user input is used in palce of format string when built with CFLAGS=-Werror=format-security:

src/helperFns.cpp:103:17:
  error: format not a string literal and no format arguments [-Werror=format-security]
  103 |         mvprintw(TOP+5, 0, (x).c_str());
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~

Let's wrap all the missing places with "%s" format.

TamaMcGlinn commented 8 months ago

I've merged this in my fork, I'm merging everything that works and doesn't change the game too much.