Blob Blame History Raw
Fixes warning like this:

track-editor.c: In function 'show_editmode_status':
track-editor.c:257:49: error: format not a string literal and no format arguments [-Werror=format-security]
  257 |     pos += PRINT_STATUS(pos, line ? _(line) : _("None ]"));
      |                                                 ^~~~~~~~
track-editor.c:120:77: note: in definition of macro 'PRINT_STATUS'
  120 |     g_snprintf(&track_editor_editmode_status_ed_buf[pos], SEBUF_SIZE - pos, __VA_ARGS__)
      |                                                                             ^~~~~~~~~~~
track-editor.c:257:47: note: in expansion of macro '_'
  257 |     pos += PRINT_STATUS(pos, line ? _(line) : _("None ]"));
      |                                               ^
cc1: some warnings being treated as errors


diff -uNr soundtracker-1.0.1.orig/app/track-editor.c soundtracker-1.0.1/app/track-editor.c
--- soundtracker-1.0.1.orig/app/track-editor.c	2020-07-07 22:49:03.000000000 +0200
+++ soundtracker-1.0.1/app/track-editor.c	2020-09-06 21:07:38.817000000 +0200
@@ -208,19 +208,19 @@
         note->instrument);
 
     if (note->volume >= 0x10 && note->volume <= 0x50)
-        pos += PRINT_STATUS(pos, _("Set volume"));
+        pos += PRINT_STATUS(pos, "%s", _("Set volume"));
     else if (note->volume >= 0x60)
         pos += PRINT_STATUS(pos, "%s", _(vol_fx_commands[((note->volume & 0xf0) - 0x60) >> 4]));
     else
-        pos += PRINT_STATUS(pos, _("None"));
+        pos += PRINT_STATUS(pos, "%s", _("None"));
 
     if (note->volume & 0xf0)
         pos += PRINT_STATUS(pos, " => %02d ] ",
             (note->volume >= 0x10 && note->volume <= 0x50) ? note->volume - 0x10 : note->volume & 0xf);
     else
-        pos += PRINT_STATUS(pos, " ] ");
+        pos += PRINT_STATUS(pos, "%s", " ] ");
 
-    pos += PRINT_STATUS(pos, _("[Cmd: "));
+    pos += PRINT_STATUS(pos, "%s", _("[Cmd: "));
 
     switch (note->fxtype) {
     case xmpCmdArpeggio:
@@ -254,7 +254,7 @@
         line = fx_commands[note->fxtype];
         break;
     }
-    pos += PRINT_STATUS(pos, line ? _(line) : _("None ]"));
+    pos += PRINT_STATUS(pos, "%s", line ? _(line) : _("None ]"));
 
     cmd_p1 = (note->fxparam & 0xf0) >> 4;
     cmd_p2 = note->fxparam & 0xf;
@@ -281,7 +281,7 @@
                 else if (cmd_p1 == 6) {
                     /* Pattern loop */
                     if (cmd_p2 == 0)
-                        PRINT_STATUS(pos, _(" begin ]"));
+                        PRINT_STATUS(pos, "%s", _(" begin ]"));
                     else
                         PRINT_STATUS(pos, _(" %02d times ]"), cmd_p2);
                 } else
@@ -297,7 +297,7 @@
                 PRINT_STATUS(pos, " => %02d %02d ]", cmd_p1, cmd_p2);
             break;
         default:
-            PRINT_STATUS(pos, "]");
+            PRINT_STATUS(pos, "%s", "]");
             break;
         }
     }