[PATCH 24/26] uefi: uefidump: cast to ptrdiff_t to remove mixed signed/unsigned comparison

Keng-Yu Lin kengyu at canonical.com
Wed Oct 17 07:57:10 UTC 2012


On Mon, Oct 15, 2012 at 4:32 AM, Colin King <colin.king at canonical.com> wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> We shouldn't be comparing a ptrdiff_t to a size_t, so cast to avoid
> a signed/unsigned comparison.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/uefi/uefidump/uefidump.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 11c40e9..d09db0b 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -16,6 +16,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
>   *
>   */
> +#include <stddef.h>
>  #include <inttypes.h>
>
>  #include "fwts.h"
> @@ -645,7 +646,7 @@ static void uefidump_info_signature_support(fwts_framework *fw, fwts_uefi_var *v
>                 if (var->datalen)
>                         fwts_log_info_verbatum(fw, "  Signature GUIDs:");
>
> -               while (data - var->data < var->datalen) {
> +               while (data - var->data < (ptrdiff_t)var->datalen) {
>                         fwts_guid_buf_to_str(data, guid_str, sizeof(guid_str));
>                         fwts_log_info_verbatum(fw, "    %s", guid_str);
>                         data += 16;
> --
> 1.7.10.4
>
Acked-by: Keng-Yu Lin <kengyu at canonical.com>



More information about the fwts-devel mailing list