From a40954d148645ef56977d948fa9ca0a5b6b71684 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 7 Aug 2020 12:14:28 +0200 Subject: [PATCH] main: Fix fprintf security build warning ../src/ppd-utils.c: In function 'ppd_utils_write_sysfs': ../src/ppd-utils.c:36:3: error: format not a string literal and no format arguments [-Werror=format-security] 36 | ret = fprintf (sysfsfp, value); | ^~~ --- src/ppd-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ppd-utils.c b/src/ppd-utils.c index 00bdf66..37b3940 100644 --- a/src/ppd-utils.c +++ b/src/ppd-utils.c @@ -33,7 +33,7 @@ gboolean ppd_utils_write_sysfs (GUdevDevice *device, g_debug ("Could not open for writing '%s'", filename); return FALSE; } - ret = fprintf (sysfsfp, value); + ret = fprintf (sysfsfp, "%s", value); if (ret < 0) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Error writing '%s'", filename);