Skip to content

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

Open
trofi wants to merge 1 commit intojmoon018:masterfrom
trofi:master
Open

pacvim: always use "%s"-style format for printf()-style functions#53
trofi wants to merge 1 commit intojmoon018:masterfrom
trofi:master

Conversation

@trofi
Copy link
Copy Markdown

@trofi trofi commented Nov 18, 2021

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.

`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
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants