/* Description: returns 1 if valid, 0 on error.  */
static int is_pte_valid(const gpt_entry *pte, const size_t lastlba)
/* Description: returns 1 if valid, 0 on error.  */
static int is_pte_valid(const gpt_entry *pte, const size_t lastlba)
{
    if ((!efi_guidcmp(pte->partition_type_guid, NULL_GUID)) ||
        (uint64_t)(pte->starting_lba) > lastlba         ||
        (uint64_t)(pte->ending_lba)   > lastlba)
    {
        return 0;
    }
    return 1;
}