cmd: fix gpt setenv
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 26 Aug 2023 01:53:41 +0000 (03:53 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 27 Aug 2023 06:21:07 +0000 (08:21 +0200)
commit018346770b04e32caf75d5730301f3ba52ed005f
tree979249cc9ab2afe5247e1565849f9ac045209201
parenteb48efce260aefc0eceec90bd4d9adcd881f1b14
cmd: fix gpt setenv

Do not assume that partitions are continuously numbered starting at 1.

Having a partition table with a single partition 63 is valid.

Fixes: 12fc1f3bb223 ("cmd: gpt: add eMMC and GPT support")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/gpt.c