Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1pUBLQ-00037K-Mu for mharc-grub-devel@gnu.org; Mon, 20 Feb 2023 13:57:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUBLH-00034s-Rx for grub-devel@gnu.org; Mon, 20 Feb 2023 13:56:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUBLD-0007A5-Uu for grub-devel@gnu.org; Mon, 20 Feb 2023 13:56:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676919406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MCJXfTC0y1NurE9XOwMJYvgUHwxkV621jA9z2c84p+A=; b=GSyhwjO0jZA6thfK/7j/yjAvUMKoCt7FSlKW2k27UnviGR91PHf3cb6FKJR5nWS9/9THOs lf/rCypIx0NhKdgP4y+jpcJYqpi8xd8AHaOzLdB2tPy0JW8RGOtfCSjXknhRGQzBDYz7XC vfwCyH+tc//sydFPyjTKhgzpRC1GI4U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-376-zxcTKIBGNZ-klhHPkdHw0w-1; Mon, 20 Feb 2023 13:56:45 -0500 X-MC-Unique: zxcTKIBGNZ-klhHPkdHw0w-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BC2680D0E0 for ; Mon, 20 Feb 2023 18:56:45 +0000 (UTC) Received: from osteffen-laptop.redhat.com (unknown [10.39.192.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE34B2166B26; Mon, 20 Feb 2023 18:56:44 +0000 (UTC) From: Oliver Steffen To: grub-devel@gnu.org Cc: kraxel@redhat.com, Oliver Steffen Subject: [PATCH v2 6/7] commands/probe: use grub_gpt_part_guid_snprint Date: Mon, 20 Feb 2023 19:56:29 +0100 Message-Id: <20230220185630.1404033-7-osteffen@redhat.com> In-Reply-To: <20230220185630.1404033-1-osteffen@redhat.com> References: <20230220185630.1404033-1-osteffen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Received-SPF: pass client-ip=170.10.133.124; envelope-from=osteffen@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Feb 2023 18:56:54 -0000 Use the new function for printing the partition guid. Signed-off-by: Oliver Steffen --- grub-core/commands/probe.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/grub-core/commands/probe.c b/grub-core/commands/probe.c index 9a80ea54f..3fe50d11e 100644 --- a/grub-core/commands/probe.c +++ b/grub-core/commands/probe.c @@ -104,7 +104,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args) if (state[6].set) { /* AAAABBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF + null terminator */ - char val[37] = "none"; + char val[GRUB_GPT_GUID_STR_LEN + 1] = "none"; if (dev->disk && dev->disk->partition) { struct grub_partition *p = dev->disk->partition; @@ -130,14 +130,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args) return grub_errno; } guid = &entry.guid; - grub_snprintf (val, sizeof(val), - "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - grub_le_to_cpu32 (guid->data1), - grub_le_to_cpu16 (guid->data2), - grub_le_to_cpu16 (guid->data3), - guid->data4[0], guid->data4[1], guid->data4[2], - guid->data4[3], guid->data4[4], guid->data4[5], - guid->data4[6], guid->data4[7]); + grub_gpt_part_guid_snprint (val, sizeof(val), guid); } else if (grub_strcmp(dev->disk->partition->partmap->name, "msdos") == 0) { -- 2.39.2