boysetsfrog / vimpc

Official repository for vimpc a vi/vim inspired client for the Music Player Daemon (mpd). Pull requests are welcome.
GNU General Public License v3.0
269 stars 34 forks source link

vimpc: always use "%s"-style format for printf()-style functions #100

Closed trofi closed 1 year 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/window/listwindow.cpp:120:16:
  error: format not a string literal and no format arguments [-Werror=format-security]
  120 |       mvwprintw(window, line, 0, BlankLine.c_str());
      |       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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