fix printf format-security warning.
authorRobin Gareus <robin@gareus.org>
Tue, 27 Jan 2015 13:04:19 +0000 (14:04 +0100)
committerRobin Gareus <robin@gareus.org>
Tue, 27 Jan 2015 13:04:19 +0000 (14:04 +0100)
 warning: format string is not a string literal (potentially insecure) [-Wformat-security]

gtk2_ardour/ardour_ui.cc

index 249750606827254da4ff6709a45c7e690bc970df..c9ef1387af0db6aaba99e6fc7a906e6e2632295e 100644 (file)
@@ -1195,7 +1195,7 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
 
        if (!AudioEngine::instance()->connected()) {
 
-               snprintf (buf, sizeof (buf), _("Audio: <span foreground=\"red\">none</span>"));
+               snprintf (buf, sizeof (buf), "%s", _("Audio: <span foreground=\"red\">none</span>"));
 
        } else {
 
@@ -1203,7 +1203,7 @@ ARDOUR_UI::update_sample_rate (framecnt_t)
 
                if (rate == 0) {
                        /* no sample rate available */
-                       snprintf (buf, sizeof (buf), _("Audio: <span foreground=\"red\">none</span>"));
+                       snprintf (buf, sizeof (buf), "%s", _("Audio: <span foreground=\"red\">none</span>"));
                } else {
 
                        if (fmod (rate, 1000.0) != 0.0) {