From 10b2fef1bdce00bdd293c03266c20dd4d248532c Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 12 Feb 2019 08:54:20 +0000 Subject: [PATCH] trivial: Fix a 'Comparison is always true' LGTM warning Not a bug, but somewhat muddled logic I guess. --- plugins/uefi/fu-uefi-common.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/uefi/fu-uefi-common.c b/plugins/uefi/fu-uefi-common.c index 2e3268aa3..aa1d11057 100644 --- a/plugins/uefi/fu-uefi-common.c +++ b/plugins/uefi/fu-uefi-common.c @@ -376,17 +376,14 @@ gboolean fu_uefi_prefix_efi_errors (GError **error) { g_autoptr(GString) str = g_string_new (NULL); - gint rc = 1; - for (gint i = 0; rc > 0; i++) { + for (gint i = 0; ; i++) { gchar *filename = NULL; gchar *function = NULL; gchar *message = NULL; gint line = 0; gint err = 0; - - rc = efi_error_get (i, &filename, &function, &line, - &message, &err); - if (rc <= 0) + if (efi_error_get (i, &filename, &function, &line, + &message, &err) <= 0) break; g_string_append_printf (str, "{error #%d} %s:%d %s(): %s: %s\t", i, filename, line, function,