trivial: Fix invalid printf() usage

PVS: The line being passed could contain format specification.
This commit is contained in:
Richard Hughes 2022-09-09 10:43:02 +01:00
parent 76138349e2
commit f49d5ed10c
2 changed files with 11 additions and 11 deletions

View File

@ -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 || if (fwupd_device_get_battery_level(dev) == FWUPD_BATTERY_LEVEL_INVALID ||
fwupd_device_get_battery_threshold(dev) == FWUPD_BATTERY_LEVEL_INVALID) { fwupd_device_get_battery_threshold(dev) == FWUPD_BATTERY_LEVEL_INVALID) {
/* TRANSLATORS: for example the batteries *inside* the Bluetooth mouse */ /* 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 */ /* TRANSLATORS: for example the batteries *inside* the Bluetooth mouse */
return g_strdup_printf(_("Device battery power is too low (%u%%, requires %u%%)"), return g_strdup_printf(_("Device battery power is too low (%u%%, requires %u%%)"),

View File

@ -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_current_value(attr),
fwupd_security_attr_get_bios_setting_target_value(attr)); fwupd_security_attr_get_bios_setting_target_value(attr));
g_string_append(body, "\n\n"); g_string_append(body, "\n\n");
g_string_append_printf(body, g_string_append(body,
/* TRANSLATORS: the user has to manually recover; we can't do it */ /* TRANSLATORS: the user has to manually recover; we can't do it */
_("You should ensure you are comfortable restoring the setting from " _("You should ensure you are comfortable restoring the setting from "
"the system firmware setup, as this change may cause the system " "the system firmware setup, as this change may cause the system "
"to not boot into Linux or cause other system instability.")); "to not boot into Linux or cause other system instability."));
fu_util_warning_box(title->str, body->str, 80); fu_util_warning_box(title->str, body->str, 80);
/* ask for confirmation */ /* ask for confirmation */
@ -3948,11 +3948,11 @@ fu_util_get_bios_setting(FuUtilPrivate *priv, gchar **values, GError **error)
return FALSE; return FALSE;
} }
if (!found) { if (!found) {
g_set_error(error, g_set_error_literal(error,
FWUPD_ERROR, FWUPD_ERROR,
FWUPD_ERROR_INVALID_ARGS, FWUPD_ERROR_INVALID_ARGS,
/* TRANSLATORS: error message */ /* TRANSLATORS: error message */
_("Unable to find attribute")); _("Unable to find attribute"));
return FALSE; return FALSE;
} }
return TRUE; return TRUE;