]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
mce-intel-p4-p6: prevent build errors with -Werror=format-security v0.6.0
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 14 Oct 2017 10:26:30 +0000 (07:26 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 14 Oct 2017 10:28:46 +0000 (07:28 -0300)
On Fedora, -Werror=format-security is now used on packages, with
causes the following build error:

mce-intel-p4-p6.c: In function 'p4_decode_model':
mce-intel-p4-p6.c:130:4: error: format not a string literal and no format arguments [-Werror=format-security]
    mce_snprintf(e->error_msg, p4_model[i].str);
    ^~~~~~~~~~~~
cc1: some warnings being treated as errors

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
mce-intel-p4-p6.c

index c8e219df006f3866334448505cec00a7060cb14b..4615e1a5562002172b1769821a21e48e205843c1 100644 (file)
@@ -127,7 +127,7 @@ void p4_decode_model(struct mce_event *e)
 
        for (i = 0; i < ARRAY_SIZE(p4_model); i++) {
                if (model & (1 << p4_model[i].value))
-                       mce_snprintf(e->error_msg, p4_model[i].str);
+                       mce_snprintf(e->error_msg, "%s", p4_model[i].str);
        }
 }