fsx: Fix -Wformat-security warnings
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Tue, 29 Aug 2017 13:37:14 +0000 (16:37 +0300)
committerEryu Guan <eguan@redhat.com>
Sun, 3 Sep 2017 04:19:26 +0000 (12:19 +0800)
commit8d085f7a03d472caafd8f82172bee2bdaacd6a73
tree07a19be79efd24d8b2194f27d64aadab4a25a15d
parentd7286fbaa69df1e9625e7d311dcb9503883a96ee
fsx: Fix -Wformat-security warnings

Some distros (NixOS) have their build environment enable
-Werror=format-security by default for security/hardening reasons.
Currently fsx fails to build due to this:

fsx.c: In function 'prt':
fsx.c:215:18: error: format not a string literal and no format arguments [-Werror=format-security]
  fprintf(stdout, buffer);
                  ^
fsx.c:217:20: error: format not a string literal and no format arguments [-Werror=format-security]
   fprintf(fsxlogf, buffer);
                    ^
Indeed the compiler is correct here, if the message-to-be-printed were
to contain a '%', unpredictable things would happen. Fix this.

Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
ltp/fsx.c