From f49d5ed10c12beef6043cfd5f217597e95a97fd0 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Fri, 9 Sep 2022 10:43:02 +0100 Subject: [PATCH] trivial: Fix invalid printf() usage PVS: The line being passed could contain format specification. --- src/fu-util-common.c | 2 +- src/fu-util.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/fu-util-common.c b/src/fu-util-common.c index 9e778b8b6..91621b9c6 100644 --- a/src/fu-util-common.c +++ b/src/fu-util-common.c @@ -1349,7 +1349,7 @@ fu_util_device_problem_to_string(FwupdClient *client, FwupdDevice *dev, FwupdDev if (fwupd_device_get_battery_level(dev) == FWUPD_BATTERY_LEVEL_INVALID || fwupd_device_get_battery_threshold(dev) == FWUPD_BATTERY_LEVEL_INVALID) { /* TRANSLATORS: for example the batteries *inside* the Bluetooth mouse */ - return g_strdup_printf(_("Device battery power is too low")); + return g_strdup(_("Device battery power is too low")); } /* TRANSLATORS: for example the batteries *inside* the Bluetooth mouse */ return g_strdup_printf(_("Device battery power is too low (%u%%, requires %u%%)"), diff --git a/src/fu-util.c b/src/fu-util.c index 371a7a8df..52b2dd27f 100644 --- a/src/fu-util.c +++ b/src/fu-util.c @@ -3412,11 +3412,11 @@ fu_util_security_modify_bios_setting(FuUtilPrivate *priv, FwupdSecurityAttr *att fwupd_security_attr_get_bios_setting_current_value(attr), fwupd_security_attr_get_bios_setting_target_value(attr)); g_string_append(body, "\n\n"); - g_string_append_printf(body, - /* TRANSLATORS: the user has to manually recover; we can't do it */ - _("You should ensure you are comfortable restoring the setting from " - "the system firmware setup, as this change may cause the system " - "to not boot into Linux or cause other system instability.")); + g_string_append(body, + /* TRANSLATORS: the user has to manually recover; we can't do it */ + _("You should ensure you are comfortable restoring the setting from " + "the system firmware setup, as this change may cause the system " + "to not boot into Linux or cause other system instability.")); fu_util_warning_box(title->str, body->str, 80); /* ask for confirmation */ @@ -3948,11 +3948,11 @@ fu_util_get_bios_setting(FuUtilPrivate *priv, gchar **values, GError **error) return FALSE; } if (!found) { - g_set_error(error, - FWUPD_ERROR, - FWUPD_ERROR_INVALID_ARGS, - /* TRANSLATORS: error message */ - _("Unable to find attribute")); + g_set_error_literal(error, + FWUPD_ERROR, + FWUPD_ERROR_INVALID_ARGS, + /* TRANSLATORS: error message */ + _("Unable to find attribute")); return FALSE; } return TRUE;