[PATCH 08/17] zramctl: fix two format string warnings

Sami Kerola
2014-09-07T12:43:31Z

Both warnings were similar.

sys-utils/zramctl.c:527:23: warning: format string is not a string
literal (potentially insecure) [-Wformat-security]
err(EXIT_FAILURE, zram->devname);

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
sys-utils/zramctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys-utils/zramctl.c b/sys-utils/zramctl.c
index 961dba1..786be06 100644
--- a/sys-utils/zramctl.c
+++ b/sys-utils/zramctl.c
@@ -524,7 +524,7 @@ int main(int argc, char **argv)
if (optind < argc) {
zram = new_zram(argv[optind++]);
if (!zram_exist(zram))
- err(EXIT_FAILURE, zram->devname);
+ err(EXIT_FAILURE, "%s", zram->devname);
}
status(zram);
free_zram(zram);
@@ -560,7 +560,7 @@ int main(int argc, char **argv)
else {
zram = new_zram(argv[optind]);
if (!zram_exist(zram))
- err(EXIT_FAILURE, zram->devname);
+ err(EXIT_FAILURE, "%s", zram->devname);
}

if (zram_set_u64parm(zram, "reset", 1))
--
2.1.0