jatinchowdhury18 / ChowDSP-VCV

ChowDSP modules for VCV Rack
GNU General Public License v3.0
81 stars 8 forks source link

Fix build with -Wformat-security #24

Closed falkTX closed 2 years ago

falkTX commented 2 years ago

printf-related functions without format string are a security issue, so a few systems have that as an error by default, thus breaking the build.

In file included from ChowDSP/src/Credit/Credit.cpp:4:
ChowDSP/src/Credit/ModuleWriter.hpp: In member function ‘void ModuleWriter::operator()(FILE*)’:
ChowDSP/src/Credit/ModuleWriter.hpp:114:20: error: format not a string literal and no format arguments [-Werror=format-security]
  114 |             fprintf(file, pStr.c_str());

This patch fixes the issue. We could alternatively use fputs but that places a newline at the end, which is not always wanted.

jatinchowdhury18 commented 2 years ago

Ah, I was not aware of this. Thanks!